form submit onclick not running jQuery function
Hi All, my first post..completely stumped. My simple jQuery function below works on window.onload, body "onload=", but will not work when fired from a forms submit button. i've tried 2 ways, onclick in the forms button, and also, it's id in an unobtrusive jQuery function. the code is below. wh function openConfirm() { $(function() { $('#confirm').fadeIn('normal'); }); } the form code is - <input type="image" src="img/btn_submit.gif" value="Submit" alt="Submit" id="submitbtn" onclick="openConfirm()"
(function($) { code })(jQuery) not working?
(function($) { /* some code that uses $ */ })(jQuery) seems to not work in jQuery 1.4.2. Nothing inside happens. I got it down to a simple alert('hello world'); and still nothing. Is this just me or have I missed something. Here is where it's documented and no changes from 1.4.2 have been posted on this page: http://docs.jquery.com/Using_jQuery_with_Other_Libraries
Multiple selects - how can I populate more than just the first one.
Hi jQ, I have a form that generates 'n' amount of related select boxes. Some records will have one set of related select boxes where others will have ten sets. I'm struggling with a technique in which I can get each of the children select boxes populated based on the value of it's parent. Currently I'm only able to find the very next select box and get it populated (by class I believe), but when I go down to the next set of select boxes, the change function is still only reading the value from the
Iterating thro a list of elements and getting their ID back in an Array
Hi all, I am new to Jquery and still trying to feel my way around it. I have this piece of code snippet below // Html Code that will be generated dynamically - display of company names with close("X") icon next to the name of the company <div> <div class="result" id="companyName"> <span class="ui-icon ui-icon-close"></span> <div id="3">Company1</div></div>
What does 1 - 1, 1 stand for in minDate?
as far as i can see it is not explained in http://jqueryui.com/demos/datepicker/#option-minDate $('.selector').datepicker({ minDate: new Date(2007, 1 - 1, 1) });I understand the 2007. I did some troubleshooting and i think the firts 1 stands for the month.. so what does the second 1 stand for (the one after the - and before the ,)? I gues that the last 1 stands for the day, please confirm. THNX !!
Warning: Unresponsive script
I am using a simple ASP.Net Grid and using the .hover() function to highlight the Table Rows on mouse over. $("table.scrollTable td").hover( function() {$(this).parent("tr").addClass('rowSelect'); }, function() { $(this).parent("tr").removeClass('rowSelect'); }); Its works fine when the records are less.. but when the records go above 150 rows it hangs the browser and gives a unresponsive script error saying "A script on this page may be busy, or it may have stopped responding.
$.get() does not work without a filename specified
Hi, I try to load the contents of a user-specified url, like so: $.get( urlValue, function(data) { alert('page content: ' + data); }); This works fine for url's that contain a filename, such as http://mysite.com/index.html It does not work for url's without a filename specified. such as http://mysite.com or http://mysite.com/ When I try that: - data is empty (not null, just empty) - the textStatus is "success" and the XMLHttpRequest.readyState is 4 (= complete).
How to select specific characters and replace them
Hello All i need some help Consider the folowing html: <div class="date">2010-01-30</div> Using the .replaceWith Method how can I select the " -01- " and replace with "<span>JAN</span>" Thankyou
Using a map
Hi there, Not sure if this a JQuery question or a javascript one. Let's see it. I have a web application where initially it is loaded a map with ids and names. Later, periodiocally a json containing the userId and a message is processed. Initially, I tried to define the map like this: var ids = [ {${user.id} : '${user.name}} ]; This is loaded within a loop in jsp, so we got something like this: var ids = [ {34:'user1'}, {500:'user2'}] The problem with this declararion is that for getting an id when
Not using document.ready
Hi, noob to jq but have a questions: what if I don't want to put everything inside the document.ready function? what if I want separate functions? how would I go about writing that stuff?
problem with IE8 only
Hi, I wrote this web page : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" > <head> <title>TEST</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> //<![CDATA[ // gestion du menu $(document).ready(function(){ $("div.blocTab > ul.radbut > li > h5 > a").click(function(e){
busy indicator on pageload
I want to show a busy indicator on page loading. I am using ASP .net MVC. the problem is that if i show the busy indicatr on "onload" then i cant stop it
Get ID of a clicked parent ID
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> var ddmenuitem = 0; function jsddm_open() { // When "help-menu" being click, I will toggle drop down menu. ddmenuitem = $(this).find('ul').eq(0).toggle(); } function jsddm_close(evt) { // When everywhere in the document except "help-menu" being clicked, I will close the drop down menu. // How I can check everywhere in the document except "help-menu"? var id
Support of underscore for formatting link names
Hello! I"m using http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js for the line breaking of the link-names. It works wonderfull if the link is hyphenated like my-loooooooooooooooooooooooong-link-name, but ignores if it is with undescore. How can one add a support the line breaking by underscore? for example: my_loooooooooooo_oooooooooooong_link_name.pdf will be: my_loooooooooooo_ oooooooooooong_link_name.pdf thank you, best regards, tanja
Simple bug fix IE xml parse problem
As you might know, IE often has trouble parsing XML data received from an ajax request. When you call the function belong on the data, you can also parse it in IE. function ieAjaxBugFix(data) { $("#_jqueryAjaxBugFix").remove(); $("body").append("<div id=\"_jqueryAjaxBugFix\"></div>"); $("#_jqueryAjaxBugFix").html(data); return $("#_jqueryAjaxBugFix").html(); } An example: $.get("www.example.com",function(data) { data = ieAjaxBugFix(data); $("#content").append($(data).find("#menu").html());
[Solved] Each Iteration overrides my defined variable
Howdy, i've tried to search with google for problem but i can't find any solution. And i'm also not really familar with JavaScript :o/ My problem is jQuery overrides on each iteration the current value of my variable. So i get only the last element. Logically normal imho. But how can i solve it? This is the specific part of my code: $(this).find("product").each(function() { getProducts = '<li>' + $(this).attr('artikelnummer') + "</li>"; }); Here you can see the whole context: $.ajax({
Slider event.originalEvent?
hi, the JQuery UI Slider Events documentation states " Use event.orginalEvent to detect whether the value changed by mouse, keyboard, or programmatically. " I'm thinking this is what I want to avoid a feedback loop where a calendar sets a slider value, and vice versa. But I can't find how to use it. In the scope of the slider's change: event handler function, event.orginalEvent appears to be "undefined". Can anyone confirm how to use with a code sample? many thanks.
select menu don't appear on ie7 after an ajax request
I have the following problem : on doing a ajax request on a php file in order to show customer informations. In these informations, I'm building a select menu. this select menu doesn't appear on the page result on ie7 where it works fine on safari and firefox. here is the code : the AJAX request on the gestionCommande.php file if ($('#connecte').length) { $("#information_livraison_facturation").css({display:"block",opacity:0}).animate({opacity:1}, function () { $("#information_facturation").css({display:"block",opacity:0}).animate({opacity:1},
A bug in what I'm doing, maybe you can help me squish it?
Hello, Thanks to a member on this forum what I'm trying to do is almost complete. I just have one bug that was there from the beginning and I'm not sure how to fix it. What I'm doing is I have a set of 5 images that march across the page. They scroll to X spot, pause, then scroll the next image. The images are in an endless loop. Here is the demo page: DEMO I have it cross browsed for IE6/7/8, Safari, Chrome, Opera, FF, and iPhone. The only bug I have is if you mouse over / mouse out of the scroll
.add() with a table data a few questsions since it's not workign for me.
OK here's the exact code right here. I don't know why it's not working for me. I click on it and it's not adding it to itself. I've looked over it but i think it may be an append issue, but the problem is that i thought it'd just add itself all nice and calmly. <div> <table> <tr><td class="objective">Objective:<input type="text"></td></tr> </div> <script> $(".objective").click(function () { $(this).add("<td class='objective'>Objective:<input type='text'></td>"); }); </script>Any help is
ie7 slow searching by class name with 'each'
I've read a lot about how slow IE7/javascript is, but I thought I'd share this test. I have a complex page with about 15 tables of class XYZ. I timed this: $('.XYZ').each(function(i){ }); Vs this: $('TABLE').each(function(i){ }); In IE7 the 1st one takes 1400ms, and the 2nd one takes 30ms. Apparently searching the DOM by class name is horribly inefficient. Just thought I'd share, since it took me a while to figure out this slowness...
Resize iframe on a.com from b.com ?
Web site: a.com has this code: <iframe src='http://b.com/script.php' name=x width=200 height=200></iframe> I need somehow from b.com/script.php change the iframe height on a.com height must be based on iframe content. Any ideas ? Thanks.
JQUERY live() AJAX Request
I have a strange issue, works fine in safari, but not in firefox.... Oh, and the form with the class .fjax is being loaded itself by ajax. /// football form $('.fjax').live("submit", function() { var fields = $(this).serialize(); var path = this.action; $.ajax({ type: "POST", url: "pages/" + path, data : fields, //dataType : "xml", success: function(msg) { alert('ok'); $('input[type=submit]',
Prevent jumping to the top on an event
Hello, I am a little stuck on a problem and hope that someone can help me a little. I want to prevent that the browser jumps to the top on an event. I know that I could return false to stop this behavior but the element has more then one event. If I return false on the first event it stops every other event after the first. How can I solve this? function managefocus(){ //return false here stops the keydown event return false; } $('#test').keyup(managekeyup); $('#test').keydown(managekeydown);
[QUnit] Re-initializing code from $(document).ready function(s)
In an effort to not duplication initialization code, I want to be able to rerun the $.ready function in the setup of each unit test rather than copy the actual code to the setup of the test. In jQuery 1.3.2, I was able to achieve this by overriding the jQuery.ready function with the following code: "use strict"; jQuery.ready = function () { // Remember that the DOM is ready jQuery.isReady = true; // If there are functions bound, to execute if (jQuery.readyList)
IE 8 Compatibility View Issues
Please check out the following link (in IE 8): http://www.expertpcservice.com/eugene/ As you will notice if you click on Show Player Rows: Button 2 and then Button 1 it works fine. Then if you try to click on Show Front 9/Back 9: Button F it will go into compatibility view, and then buttons 1 and 2 do not work any more. Below is the following functions that are run when you click on the respective buttons: /*Function for Button 1*/ function display1Row() { $('tr.playerRow2_off').removeClass('playerRow2_on');
invalid label { "type": "FeatureCollection" Error in firebug for $.getJSON
Hi, Please refer to this gist http://gist.github.com/331432 for the code. If you open the html in Firefox browser, you will get this error invalid label { "type": "FeatureCollection",\n I googled about this error and found that many other ppl have faced similar issue, but I did not found a solution for this. How to get rid of this error? -- Anil
Target an iFrame with no id within a div?
I am trying to set some styles for an iFrame contained within a div. I know the div's id but the iFrame has no id. What is the proper way to target the iFrame?
slideUp/slideDown sync problem
I'm building an accordion menu (trying to do it without an accordion plugin!). This example http://adamkobrin.com/slidingMenu2.html works well but I'm wondering: Is their a way to PERFECTLY sync up the slideDown of one section with the slideUp of the other? Now using this line of code $hiddenMenu.slideDown(150).siblings('ul:visible').slideUp(150);works, but notice the slight shift at the bottom, due to out-of-sync sliding. I've tried altering the timing subtely in the parameters, and with
absolute positioning from bottom?
hello, i wonder if there's a way to find an absolute position of a div-layer from the bottom of the page with some jquery-code. i need the bottom-value of this container, because my elements are positioned from the bottom of the page. any ideas?
[RESOLVED] Using data from an XML file
Hello, I need to get data from an XML file. I loaded it, and I can use it.. But I don't know how to get a specific value... I know it's lil bit complicated to understand, but please help me. :( My XML file looks like this : <departement> <num>01</num> <ensoleillement>1019</ensoleillement> <revenus>61.15</revenus> </departement> <departement> <num>02</num> <ensoleillement>822.5</ensoleillement> <revenus>49.4</revenus> </departement> <departement>
Trouble with internet explorer 7
Hi - wondered if someone might be a ble to take a look at my site which is nearly ready to go live? It's working well in all browsers apart from internet explorer 6 / 7 . I'm not even going to try to support 6 so let's just worry about 7 - this is driving me insane! It uses quite a few jquery plugins and loads jquery and jquery tools through the jquery tools cdn. The trouble is that in ie 7 the javascript doesn't work properly and means the page is useless! I tested it using firebug and no error
Can't get the animation to work correctly with multiple items....
Hi, If you look at this page http://tijmensmit.com/dev/jquery/slide_no_animation.html you will see that if you hover over the photo the text block goes up, and if you hover over the text it slides down and covers the photo. It's all pretty basic and it works fine. But ones I try to get them animated during the sliding up and down the trouble starts. It works fine if you take the time and wait for them to go back to their starting position, but if you move over the items quickly it becomes a mess.
event on new non jquery content
im searching for the reason jquery don't recognises events on new added content. im adding some new inputs with xajax or firebug but jquery don't starts the onclick event. $(document).ready(function() { $("input").click(function(){ xajax_push(2); }); }); is it cause jquery recognises only the content, what have been ther at onload or added by jquery? if you need more information let me know. thanks for help
ul li mouseover
i am trying to do a mouseover effect with some images inside an unordered list. i have a lot of divs in my html (some are generated) but its fairly straight forward. i have tried all sorts of variations on my jquery code below but cannot get it to alert me. i am not sure if the other div containers matter at all or not. i am banging my head against the wall here, any input would be appreciated. Jim $(document).ready(function() { $("#navigation li") .hover(function(){ alert('you
Trapping the form reset event?
like: $('form#myForm').bind('reset',function(){}); but not. How do I register a handdler to the form reset event?
setOffset in Chrome with hidden objects
I want to setOffset on items before they are shown. However, as offset() always returns {top:0,left:0} on items with display: none, this doesn't work. I suggest not using the curTop and curLeft values if the offset is 0,0 and the item !is(:visible)
Pause function?
hello, What I'm doing is I have a set of 5 images that march across the page. They scroll to X spot, pause, then scroll the next image. The images are in an endless loop. Here is the demo page: DEMO Here is the jQuery: var scrollX = 0; var n = 0; var triggerID; var speed = 4000; //speed in ms $(function() { function scrollHor() { $('img:eq(4)').last().clone().insertBefore($('img:eq(0)')).hide(0); $('img:eq(0)').show(2000); $('img').last().remove();
button > get id,poisiton divs (draggable,droppable)
hi, i have droppable , draggable scripts from jquery. It's flow diagram. i want to have button, to collect information like id and position of divs after dropped to send a database. http://qkpic.com/fc3f2 http://qkpic.com/0ad40 code can you please help me ?
Ajax Web service call not working in Chrome and IE but work in FF
Hi I was trying to call a web service using Jquery Ajax with the url (http://localhost:8080/geoserver/wms?service=wms&version=1.1.1&request=GetCapabilities) which usually returns an xml . This call works well with Firefox. But in Chrome and IE this is not working. if I change the url to an xml file (http://localhost:8080/geowebcache/jquery/wms.xml), work in Chrome and FF but not in IE can some one give me an example , call a web service which work in Firefox , Chrome and IE Thanks sur
Next Page