jquery

jquery cookie plugin or php cookie ?

I'm trying to find the best way to use cookies for saving some products (wishlist). I want to use it to set the product_id into cookie. What would be the best option to use? jQuery cookie plugin or PHP cookies ? ...

jQuery flexible hide/show of fieldsets

I want to enhance some fieldsets with the option to show / hide their contents upon clicking their label. Currently, the HTML looks like this: <fieldset> <legend>Fieldset 1</legend> <!-- Some input, p, div, whatever --> </fieldset> <fieldset> <legend>Fieldset 2</legend> <!-- Some input, p, div, whatever --> </fieldset> ...

Setting onbeforeunload on body element in Chrome and IE using jQuery

I have a system where I want to check with the user if they're sure they want to leave the page once a dirty flag is set. I'm using the following code - In FireFox, I can look at the page source through FireBug and the tag correctly has the onbeforeunload attribute inserted in it. In Chrome and FireFox, this doesn't happen though an...

Stop all active ajax requests in jQuery

Hi. I have a problem, when submitting a form all active ajax request fail, and that triggers error event. How to stop all active ajax requests in jQuery without trigerring error event? ...

Getting current URL using Jquery

Hello, I am very new in javascript and jquery. $.getJSON("idcheck.php?callback=?", { url: /*i want full url to be print*/ }, function(json){ //alert(json.message); }); How do i get current full url on page on after url: in above? Thank you ...

Replace an entire html tag with another one using Jquery?

I have: <input id="ONE" type="..." ...> I want to replace this with: <select id="TWO"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <select> How do I do that? ...

jQuery keypress event problem

Hi, I have a function (filterLeads) that I wish to call both when a form field is moved away from (blur) and when the enter key is pressed within a form field. $('#filter input, #filter select').blur(filterLeads); $('#filter input, #filter select').keypress(function(e){if(e.which == 13) {filterLeads();}}); The blur works correctly bu...

jquery Remove siblings elements, doesn't work in IE7

Hi, I'm trying to remove all the sibling elements after a particular div, lets say the div tag with id = id8. <form> <div id="id5">something ...<div> <div id="id8">something ...<div> <div id="id3">something ...<div> <div id="id97">something ...<div> <div id="id7">something ...<div> ... <div id="idn">some text ...<div> </form> To d...

Extract value of userdefined attribute of a tag using jquery

I have input tags with a user defined attribute as:- <input name="grp1" type="radio" myUDF="value1" /> <input name="grp1" type="radio" myUDF="value1" /> How can i extract the value of myUDF? The scenario is :- $("input[name=grp1]").click(function(){ this.attr("myUDF"); // This throws the exception Object doesnt support this prop...

Problem with post in MVC

I have a troubleshoot with my MVC project. I'm trying to do this: On a view i'm loading some data on a jqgrid, and based on some selections of the user, i save those selections on a javascript VAR, and i passed it via $post to a Action of the controller, that action is supposed to call it's own view and load the data i passed previously...

In Jquery on click function is not working for img in IE 6

I tried to bind click and animate function on a img tag. Its works fine in firefox. but went wrong with IE. So i simplified the code and tested only for click . Even click function is not clled. Here is my click function for my img tag with class 'arrowimg'. $('.arrowimg').click(function(){alert("Show me")}); I get this alert in FF bu...

jQuery retrieving array from attribute value

If I have: <a id="anchor" href="some link" rel="{ key1: 'value', key2 : 'value'}">text</a> How do retrieve the values in the 'rel' attribute so i can refer to them using dot notation? eg. $('#anchor').attr('rel').key1 ...

jquery select elements from html data

i use the jquery get to fetch some plain html content form a file. In the file if have several div elements and depending on the page 1 of the has to be shown. I have a workaround for the moment where i just load all the data en than hide the div's i don't need, but i looking for a better way. the code for the moment $.get(urlIn...

BODY tag disappear when using Jquery.Load()

Im trying to make a pop-up like window using jquery and its modal box. First I load the content from a html file: $("#test").load("test.htm"); Then I load the popup: $("#test").dialog("open"); This works like it should, the content of test.html is injectet into the modal pop-up. There is only one think that is wrong, and that is th...

Send asapMail without reloading page using ajax

Hi, I have a form that posts data to an aspMail file for delivery (works fine in current format), but would like to have the form data sent without having to re-direct to another page. Looks like Ajax is the way to proceed but I'm having a problem getting the setup to work. Here's how I've changed the html: Added: $('#myForm').submi...

Multiple callback on $.get

here is the code : <script> $(document).ready(function(){ $.get("realisations.shtml",function(data){$('#realisations').empty().append(data)}); }); </script> I need to execute $(".toexpand").hide(); after beeing sure the data is loaded into the div this try dont work : <script> $(document).ready(function(){ $.g...

3 jQuery Applications Together - Problem With IE6

I've combined 3 jQuery applications - sortable tabs from jQueryUI, slideshow from Six Revisions, and John Nunemaker's FancyZoom. It can be seen here. The combined application works well in FF, Chrome, and Safari, but in IE6 the slideshow does not work properly. The slides overlap the left control button making it non-functional. Help p...

action after a delay

I have a problem with this jquery script. toggle:function() { if(this.opened){ $("slideToBuyBottomBtnClosed").setStyle("display","block"); $("slideToBuyBottomBtnOpen").setStyle("display","none"); $("sildeToBuyContent").setStyle("overflow","hidden"); this.openOrCloseEffect.start({height:0}); this.opened=false }else{ $...

jQuery Highlight element on select option

I have a list of values in a drop down style select box e.g. <select id="places"> <option>Italy</option> <option>France</option> <option>Germany</option> <option>Spain</option> </select> I also have the same list of values in a div on my page e.g. <div> <span>Italy</span> <span>France</span> <span>Germany</span> <span>Spain</span> </...

jQuery ajax call containing script-tag in data

I read some values from text boxes and send them via jQuerys post method to an server. If the user enters text containing something like "bla bla", the call fails. The data looks like this in that case: var data = { myKey: 'bla <script> bla' }; And I send it to the server like this: $.post(targetUrl, data, function(x) {...}); On ...