jQuery("#formtargetname").submit() fail with e[h] error.
problem due to having a button or any field by the name "submit"
Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts
Thursday, June 21, 2012
Monday, May 14, 2012
jquery(document).ready not running
Latest jQuery seems to halt all event execution when it comes to error.
If one of the javascript contains error, other event will not be triggering.
Its one of the gotcha that i stumbled upon since jQuery 1.6
If one of the javascript contains error, other event will not be triggering.
Its one of the gotcha that i stumbled upon since jQuery 1.6
Thursday, April 12, 2012
jquery height() or width() gotcha!
When a jQuery(target).height() is called in jQuery.ready event,
will return the height of the target, excluding the size of the image inside.
the only way to do it properly is to wait for the images to be loaded, therefore,
replacing it with jQuery(window).load(...) works best :)
will return the height of the target, excluding the size of the image inside.
the only way to do it properly is to wait for the images to be loaded, therefore,
replacing it with jQuery(window).load(...) works best :)
Wednesday, April 11, 2012
jquery 1.7.2 bug?
I've a dom which is set to position: relative, style.left to 0
console.log($(target)); //return array of 1 object
$(target).css("left", "100px");
console.log(dom.style.left); //seems to return 100px, which is correct
but when i run
$(target).css("left"); // return 110px
Updates:
$(target).position() - returns position from parent offset
$(target).offset() - returns position from the screen
Example:
console.log($(target)); //return array of 1 object
$(target).css("left", "100px");
console.log(dom.style.left); //seems to return 100px, which is correct
but when i run
$(target).css("left"); // return 110px
Updates:
$(target).position() - returns position from parent offset
$(target).offset() - returns position from the screen
Example:
The only work around method i could think of is to directly set:
position: relative;
top: 0;
left: 0;
Or
jQuery(target).offset(jQuery.target.offset());
Then use dom.style.left or dom.style.top directly.
Please note that this is tested on linux chromium browser 18.
Monday, March 26, 2012
jQuery .load complete did not fire
This happen when i was dealing with an upgrade from jQuery 1.5 to 1.7.2.
It took me some struggle to find out what happened, and finally, i found the issue.
It seems that the oncomplete function will not run if the document itself somehow contains javascript with syntax error in the script. It wasn't any problem for jQuery1.5, but for jQuery 1.7.2, it seems to halt execution after loading the content to the targeted dom.
It took me some struggle to find out what happened, and finally, i found the issue.
It seems that the oncomplete function will not run if the document itself somehow contains javascript with syntax error in the script. It wasn't any problem for jQuery1.5, but for jQuery 1.7.2, it seems to halt execution after loading the content to the targeted dom.
Monday, July 4, 2011
jQuery 1.6 buggy on IE 7
Ive been trying to figure out why my jquery colorbox seems to make ie 7 browser to hang,
and then i realize it wasnt colorbox issue, but jquery 1.6.
jQuery 1.6.1 seems to have fixed it... luckily :)
Sunday, May 22, 2011
jQuery idTabs switching tab
idTabs contains a bug where you may not program it to switch tab by passing
jQuery("#mytab.idTabs").idTabs(0);
This is due to the if statement in idTabs function which collect the "selected" class in a tag to determine the active tab.
the fixed version is available here:
Monday, April 25, 2011
jQuery No Conflict
jQuery No Conflict need to be positioned after all jquery plugin has been included.
Because some plugin is still using $ in the code, therefore the noconflict will remove $ and only made jQuery or the variable assigned as jQuery function.
If you are mixing with Mootool, you should include jquery, jquery plugins, jquery noconflict, then only moo tool .
Example:
jquery/jquery-1.5.min.js
jquery/jquery-ui-1.8.9.custom.min.js
jquery/jquery.form.js
jquery/jquery.ui.datetime.min.js
jquery/jquery.noconflict.js"
Example of jquery.noconflict.js
---------------
$j = jQuery.noConflict();
---------------
Tuesday, February 22, 2011
jQuery datepicker show only month and year
This code from: http://stackoverflow.com/questions/2208480/jquery-date-picker-to-show-month-year-only
seems to work:
---------------
[script]
$(function() {
$('.date-picker').datepicker( {
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
onClose: function(dateText, inst) {
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
$(this).datepicker('setDate', new Date(year, month, 1));
}
});
});
[/script]
-----------
But the main problem is showing back the month,year in the dialog box.To do that, you will have to modify the jquery.ui.datepicker.js
with the code (line #1548, #1549):
----------------
var date = this._daylightSavingAdjust(new Date(year, month - 1, (day >= 1 ? day: 1)));
if (date.getFullYear() != year || date.getMonth() + 1 != month || (day > 0 && date.getDate() != day))
----------------
Wednesday, December 29, 2010
jquery.form onsubmit
jQuery has a plugin for form which does alike mootool .load method for form..
If you need to submit the form through javascript, you may not use
document.formname.submit(), as this will bypass the onsubmit event.
To make it work, use $("#formid").submit();
Reference:
Monday, November 22, 2010
ExtJS
Extjs was extended from originally the open source version of YUI.
I find that, due to lack of easy google search on documentation / tutorial on extjs (or maybe because im not good at looking for extjs keywords), i find it quite difficult to pick it up.
I've found an example for jQuery lover:
jQuery examples:
jQuery("#my_field_id") or $("#my_field_id")
ExtJS:
Ext.get("my_field_id"); // return single element with id
Ext.select("#my_field_id div span a");// return array, alike jQuery selector
I've found a good basic tutorial here:
Subscribe to:
Posts (Atom)