Pop Up window after form submit
Hi I have an HTML page which pases some value on button click event to an API using jquery and its succesfully running.It returns true or false.i want that if its returns true a popup box should appear where i have to show some message. i dont know how to do so after getting that respose as user have already submit the form. Please help Thanx in advance
Sequential Loading and IE
Hello jQuery Masters, I'm new to jQuery and thought that the best way to learn it would be to write me something useful. Perhaps I bit off more than I can chew, nonetheless, I'm about 98% done a project that I've been working on for some time, and Internet Explorer has reared it's ugly head and bit me in the gonads. Doesn't even matter which IE: 8, 7, 6 all do the same thing, and Chrome, Firefox and Safari all seem to work just fine. Now I realize jQuery is designed to work with everything, so I'm
Dialog clone & fckeditor on IE8
I am having problem with displaying data in fckeditor. I am opening clone dialogs that display forms from another page. Everything comes up fine but fckeditor is not displaying any data in it. This only happens on IE8, no issues on FF. If I view this page outside the jquery dialog everything works fine. So there is conflict between jquery dialog and fckeditor. Anyone has any ideas?
Accessing selectors in a nested iframe - why is it a (timing) problem?
I have a layout made of a few iframes nested in a "frameset" like top page. I would like to load jQuery (and all my other plugins) at the top level only. I'm accessing jQuery from each iframe by calling top.$ I am selecting selectors in my iframe using top.$('#iframeid').contents().find('#id_in_iframe) These calls always fail, but in a debugger they sometimes work (timing?). I've minimized the sample, see the source code below. The bug manifests as: In the inner iframe, Try8_5CCCC.php, the first
firebug warning with keydown events
Hi Folks, http://jsbin.com/etimu/edit why does FireBug show a warning like, "the charCode property of a keydown event should not be used. It's value is meaningless" if I bind a keydown/keyup event to the document itself? It's just a warning, but it's a little bit annoying and must have a reason? Kind Regards --Andy
Create functions dynamically
I am reading from a database and read the number of elements from a text box at the end of the program (line 3). This is not working, but is there a way to achieve the same result? (assuming that there is no errors in my syntax). Thank you in advance <script type="text/javascript"> $("document").ready(function(){ var total = $("#number_of_elements").val(); var name_header = ""; var name_div = ""; for(var i=1;i<=total;i=i+1){ name_header = ".top_header" +
Create functions dynamically
In my site, I am reading from a database, get the total number of elements (line 3) and display chunks of data in div's. But I need to add functions to these div's. The following code is not working, is there an alternate way of achieving this? Thanks in advance <script type="text/javascript"> $("document").ready(function(){ var total = $("#number_of_elements").val(); var name_header = ""; var name_div = ""; for(var i=1;i<=total;i=i+1){ name_header = "#top_header"
getJson + setTimeout problem
function test() { var rqUrl = "http://search.twitter.com/search.json?q=#apple+OR+#ipad&rpp=100&callback=?" callTwitterSearchApi(rqUrl); } function callTwitterSearchApi(tiwtterRequestUrl) { debug("request to twitter : " + tiwtterRequestUrl); // *** FIRST CALL WORKS GREAT... *** $.getJSON(tiwtterRequestUrl, callTwitterSearchApi_callback); } function callTwitterSearchApi_callback(jsonPostsResults) { debug("callback"); if (jsonPostsResults == null) { debug("Why is jsonPostsResults
$.getJSon with setTimeout problem?
I make a call to the twitter API. 100 posts are retreived + a properties that tells me what the next page to call is. So I wait 5 sec. and call that next page, but the JSon results in the callback function is always null the second time... I think it's probably a JQuery problem... Here's the code to test it if you want : type="button" onclick="test();" value="test" /> /> id="debug" cols="80" rows="20"> So, at line 20, at the second callback (back from the 1st setTimeout call),
Changing background image once per session
I can successfully change the background image using the following: jQuery(document).ready(function($) { $("div#largeimage").randombg({ directory: "http://path/to/imgs", //directory to image folder howmany: 3 //how many images are in this folder }); }); But, what I want to do is change this ONCE per user session. So instead of change this on every refresh / page load I want to load it once, store that setting in a cookie/session, and not do it again until the next session. Hopefully that makes sense.
Confused about this code, can anyone help?
I am not sure why it doesn't work when I click on update button. It definitely goes inside the block and if I do an alert it works but the slideUp function doesnot work with the div. Anyone can shed some light please? <script type="text/javascript"> $(document).ready(function() { $('.update').click(function(){ //alert('it works'); $('#test').slideUp(); }); }); </script> <div id='test' style="background:#cc0000; width:300px; height:300px;"></div>
.html() doesn't return params within object tag in IE
Hi, I have the following code: <div id="object-container"> <object data="some-file.swf"> <param name="src" value="some-file.swf" /> </object> </div> I want to grab the contents of #object-container and inject them into a different place on the page. The code I have to do this works fine in firefox, but in IE it's only getting the opening and closing object tags, not the param tags: var code = $('#object-container').html(); $('#other-div').html(code); Does anyone know how to reliably get
Popup on loading home page
Pretty much of a newbie here but I have jquery working when a user clicks and image. I want to know how to load a windows with an image and text with urls on load of the home page.
.data() inconsistent return value
The .data() function returns inconsistent values: If you try to load a not-existing-value of an object, which does not have ANY values stored, it will return null. But if this object has ANY value stored in it, and you load the not-existing-value, it returns "undefined". Example: <div id="div1">test</div> <script type="text/javascript"> console.log($("#div1").data("test")); // -> result: null $("#div1").data("abcdefg", 1); console.log($("#div1").data("test")); // -> result: 'undefined'
jQuery 1.4.2 inside a Firefox extension
I am evaluating jQuery for use in a Firefox extension. There are two main channels for including Javascript in an extension: overlays and modules. A Firefox code module is executed in a different context from any chrome window, so there's no chance of clobbering global variables on window. In fact, the window object does not even exist, so even trying to load jQuery as a code module is difficult. To cope with this problem, I wrote this: http://github.com/retiman/fext/blob/master/modules/fext.jsm
.ajax POST sending wrong content type
I'm running into a prob with an ajax form post where the content type is being sent to the server as text/html instead of text/javascript... here's some of my code: I do this at the top of my .js file - jQuery.ajaxSetup({ 'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")} }) I have 2 pieces of code for 2 diff fxns... the first works fine... the second posts with the wrong type - GOOD: $(".request_email_select").change(function(event) { $.ajax({ type: "POST",
json reply ignored
I'm trying to use the new autocomplete plugin (1.8rc2). But, I think this is really a json/ajax issue. I'm essentially copying the autocomplete demo remote-with-cache.html. When I enter the text in the autocomplete box I've watched with wireshark and I see the query go out to my server and the reply (with a 200 completion). If I open the net panel in FB, it also shows the reply coming back with a 200 completion. I can click on the headers tab in FB and see the headers fine. However, if I click
.append() help, please
Hello All, I am in needof some help figuring how to append a few divs in the correct places for returned xml info. Here is the code I have now: function parseXml(xml){ var paramsArr = sParams.split(','); var labelsArr = sLabels.split(','); $(xml).find('quote').each(function(){ $('div#stocks').append('<div class="stk-heading"><div class="stk-symbol">' +$(this).find(paramsArr[0]).text()+ '</div><div class="stk-name">' +$(this).find(paramsArr[1]).text()+
Tabs Margins & Color
Hi I am a newbie to Jquery. Trying to mess around with it and finding it very useful. I have some questions. 1) How do I define the margin of the Left & Right Margin of the box area below the Tab Menu .... I mean the area where you write the Web materials on. (not sure what it is call)? 2) How to change the color of the Tabs? Any help would be very much appreciated. Thank you! SL
autoscrolling infinite jquery carosuel question
I'm trying to add an autoscrolling infinite jquery carosuel to a site i'm designing and am having touble. i've checked out several examples including the two listed; Stephane Roucheray's http://code.google.com/p/jquery-infinite-carousel and Max K's Multidirectional Image Scroller http://kiusso.net/scripts/imageScroller_jquery_plugin/index.htm the problem i'm having is that in both the examples the source images all have to be the same size which got me to wondering whether there is a way of doing
Multiple DOMWindows on the same page?
I have 4 links that each open 4 separate DOMWindows. Each DOMWindow has a close window link inside. If you open each DOMWindow, one at a time, clicking "Close Window" on each before opening the next one, everything works fine. However, I'm having this problem: If I click the first link for the first DOMWindow it appears fine. If I click the second link for the second DOMWindow (without clicking close window on the first window) the second DOMWindow shows the content for BOTH DOMWindows inside. If
Using JQuery and MooTools side-by-side
Hello all; I want to use JQuery and MooTools in my HTML project, but when I attach Jquery library in it, part of codes that related to MooTools not working!!! why? <script type="text/javascript" src="Js/mootools.js"></script> <script type="text/javascript" src="Js/imageMenu.js"></script> <script type="text/javascript" src="Js/Jquery.js"></script> what must I do? Thanks.
focusin() and stopPropagation()
I have a DIV that appears on screen. I want this DIV to disappear if one clicks off the div OR if they are using the keyboard, tabs out of the div. The click part is fairly easy. When the div is shown, I attach a click event to the BODY: $('body').one('click.mySpace', function(e) { ...close my div... }); To prevent the div closing if you click INSIDE the div, I stop event propogation: $myDiv.click(function(e){ e.stopPropagation(); } That all works
How to load an xml response in javascript/jquery?
Hello all, I want to display current weather on a html page using world weather online API. So i need to parse the xml document which i get with the following url: http://www.worldweatheronline.com/feed/weather.ashx?lat=48.40&lon=10.00&format=xml&num_of_days=2&key=[my_key] If I enter this url in the browser i can see the xml document. Now i want to load this document into an object in my javascript code but it doesn't work. I tried following jquery code: var xmldoc = $.ajax({ type:
if statement and passing click event
I got a pretty large function, one that could essentially be condensed (if you feel so inclined). I would like to know how I can get my if statements inside the toggle functions working properly. I have 4 functions and 2 of them are click functions for closing (display:none). I would like to pass a listener to the toggle funciton to listen for the $close.click() The if statement in the toggle funcitons is not doing anything. <script type="text/javascript" > $(document).ready(function() { var
Alternative image if no access
I am creating a list of images which links to areas of a website. Each image is hosted within the area of the site it is linking to. The issue I am having is not all users on my site can access all areas and so; is it possible to check if an image is available (or exists). If it is, display the image and some HTML to wrap it in, if it isn't, display a different image (again, wrapped in some HTML). Any advice would be greatly appreciated. Thanks in advance.
Show = OK, Hide = Not OK
Hi Chaps, I have a PHP form with one input and a button. A jQuery script ('loading' animated gif) is triggered on the click of the submit button. I also have a Spry Validation field linked to the input. At the moment, if the validation is triggered, the animated gif continues and won't stop. The furthest I've managed to get with it, is to click the validation message to stop the animation, but what I'm really after is to stop the animation when the validation is visible/triggered, but I can't find
'Invalid argument' when trying to using .animate() with variable in ie 7
Here is my function which works perfectly well in firefox and chrome: $('.estabInput').click( function () { //alert(originalPos); dist =originalPos-(parseInt($(this).prev().css('width'))+7); alert('distance'); var distO= {}; distO.left="'"+dist+"'"; $(this).prev().animate({'left':dist},'slow');
jQuery 1.4.2 - appendTo function doesn't work with array of elements.
Consider the following code sample: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ var a=$('<div id="a" />'), b=$('<div id="b" />'), c=$('<div id="c" />'); $([a[0], b[0], c[0]]).appendTo('body'); }); </script> </head> <body> <p>test</p> </body> </html> After running this example on 1.4.2 only first element gets appended to body, but if I run same code on 1.3.2 all elements are
JQuery 1.4.2 and middle clicks problem
Hello, In previous versions I was able to do this: $('a').live('click',function (e) { alert(e.button) return false }) With that code I was able to do something on middle clicks and also to disable the default behaviour. Now, with version 1.4.2 I can't do that any more. Using the 'mouseup' event I can get middle clicks but I can't disable the default behaviour. I have tried e.preventDefault() or binding both events: .live('click mouseup',etc) but nothing works. Now, some people use
problem with JQuery .animate in ie
I have written a little jQuery script to move the field names from ontop of the text fields to the left when a user clicks to type, what I have si working fine in ie, but throws an 'Invalid Argument' in ie 7. Has anyone encounterd this before? jQuery version: jquery-1.4.2.min OS: Windows XP IE 6
Show / Hide Elements or Remove / Add Elements based on radio selection by user.
Hi I have a page I am working and I am having some trouble with: I need to show and hide areas based on a radio selection. I initally started using the show / hide feature in Jquery but the problem is the elements need to be removed but then put back if the user selects the radio button again as it has form elements that have validaion on them. The validation is still trying to validate the form elements becuase they are still on the page but just not showing. This is the radio group the
appending element and binding a mouseover event to same element
Hello I came across an unexpected behavior: I have the following markup <a href="#">hello</a>and I run this javascript $('a') .bind('mouseout', function(){ $(this).find("span[class*=pencil]").remove(); $(this).unbind('mouseout'); }) .append('<span class="pencil">pencil</span>') .find('.pencil').click(function(){ console.log('pencil clicked'); }) the strange thing it that mouse over event execute even before the mouse hover the span.pencil element.
.submit() not executed
Hello, I have the following piece of JQuery in my script. I have added the alerts for debugging purposes. $(document).ready(function() { $('.preview').click(function() { alert('1'); $('#form').submit(function() { alert('2'); }); alert('3'); }); }); And the accompanying HTML is the following: <form method="post" action="form.php" id="form"> <input type="hidden" name="key" value="value" /> <input type="submit" name="submit"
apply class selector to click event can't work, why?
HTML: <DIV id='xAA'> <INPUT type='button' class='buttonOK' value='OK'> <INPUT type='button' class='buttonCancel' value='Cancel'> </DIV> javascript code: $(document).ready(function(){ ... $('#xAA > .buttonOK').click(function(){ //do something }); }); Is there someone can help me? Thank's very much.
Correct behaviour?
If I select some elements by using $('#elem1, #elem2, #elem3') etc but the order in the DOM is elem1, elem3, elem2 Then .eq(1) will return #elem3, I thought the index would relate to the order in the selectors. Just wanted to make sure this is right so I can re-work my code.
Script debugging and 'blank' dynamic documents
Hi, I am developing an ASPX web application and use jQuery to dynamically refresh the whole page using the .load() function $(document).ready(function(){ var refresh = setInterval(function() { $("#form1").load('Default.aspx #form1 > *'); }, 9000); }); I.e. replace element with ID form1 (content) with the one returned from background page request. The code works as intended but I noticed something strange: I am debugging my application with Visual Studio 2008 and Internet Explorer
Cant get my head around ajax post....
I really cant get to grips how $.post works =( Im hoping someone can please give me a quick point in the right direction. This is my button and its function.... $('#delete').click(function() { $.post("delete.php", { delID: $(this).attr("delid")}); }); <button id="delete" type="button" delid="2">Delete</button>I just want it to go to delete.php and set $delID = $_POST['delID'] so then I can go onto mysql delete where id = $delID.... All I have in my delete.php at the moment just for testing is
problem by Jquery with mootools side-by-side
Hello all; I want to use JQuery and MooTools in my HTML project, but when I attach Jquery library in it, part of codes that related to MooTools not working!!! why? <script type="text/javascript" src="Js/mootools.js"></script> <script type="text/javascript" src="Js/imageMenu.js"></script> <script type="text/javascript" src="Js/Jquery.js"></script> what must I do? Thanks.
JQuery slide animation reveal div height issue
Hi, I have added a JQuery slide reveal effect to a page which partially shows the main content div (with text, flash and or images) for a couple of seconds then it animates to reveal the full content div. The scripted animation is added to the ".slide" class div on the page which can have various amount of height based on how much text or other elements are placed in. I have tested it on IE6 and FF 3 and it works "somewhat" fine. However testing the animation in IE7 doesn't reveal the div fully and
Next Page