Setting 'class' attribute in bulk attribute syntax without quotes breaks IE/Opera (WAS Possible bug in 1.4)
Morning peoples. I think i have found a possible bug in 1.4 but it's only in Internet Explorer 7 & 8. The following code does not work and completely ruins every peice of jquery on the page (that means everything inside $(document).ready and anyting else... $("<div/>",{ id: 'tooltip-'+rand, class: 'dock-tooltip', css : { 'position': 'absolute', 'z-index': '999', 'left': left+'px', 'bottom': '32px', 'display':
warning message Javascript Application - 0 elements!
I am using your tutorial and keep getting a warning message Javascript Application - 0 elements! Below is my code. I am using Windows 7 and mt browser is firefox. Thanks for your help Tony Prodger <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Hello jQuery world!</title> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript" src="script.js"> $('#date').datepicker({showOn: 'button', buttonText:
Class selector does not work
On my page I have a problem: selecting elements on class does not work using jQuery. The strange thing is that it does work using document.getElementsByClassName. jQuery('.ContentMethodIntroduction').css('width', '50px'); //does nothing document.getElementsByClassName('ContentMethodIntroduction')[0].style.width='50px'; //works How can this be? I thought jQuery uses the same document.getElementsByClassName (when supported)? What can be the cause of this problem? My page does pass the W3C XHTML
attribute values into an array
Hi I'm new to jQuery but loving its power. Anyway, I'm interested in discussion of the following problem: I have a collection of divs each with their own numerical id that i use for ordering. They look like something like this: <div class = "note" noteId = "1">... <div class = "note" noteId = "4">... <div class = "note" noteId ="23">... ...etc I want to read the noteId values into a javascript array. I have found two successful ways of doing this but I arrived at these solutions by trial and error
Dynamic content: loading links into a DIV
I've used jquery tools to set up some tabs which load external content (html files) into the pane. Works beautifully. However, these external html files include links that I would like to open into the same pan, effectively replacing the iframe I've been using to this point. So far I've had no luck--the links simply open into the window, rather than in the pane itself. Any ideas? Apologies if my search skills are less than stellar and this has been addressed elsewhere.
How to use the javascript this
Hi, I wonder if i in some way can use the javascript this object and how i can relate it to an object i jQuery without having to specify a id or name on the HTML tag My tip works fine if the object have a id or name, but sometime it would be nice to put the tip on the <tr> so the tip cover the whole line, but for now the reg. is id or name for the mouseout to work. So is there a way to bind events based on javascript this identifier without any more information e.g <div onmouseover="jTip(this,"Help
Need help optimizing large quantity of DOM manipulations
I have a website using jQuery that for the most part works fine, but it contains a very large form with a lot of fields. I have an option to save the settings from the form and to load and retrieve them from the server. The problem I'm running into is that the loading settings involves changing so much in the DOM (the form is huge and contains a lot of fields) that it seems to be freezing up on some browsers or timing out. I can't reproduce this on my computer (although it does take awhile to finish
Small problem with mouseout function..
I have a drop down menu that activated when a mouse is over an <li> element. It shows a small drop down menu. With the same function (that shows shows the sub-menu) I have a function call. This function call will build a string variable of html, and uses html() to insert the variable information into the sub menu's html(). Then I have a 2nd function. This function will hide the menu, with mouseout(). The problem is, it will activate this function when I hover over an element and then when the
Firefox (3.6 on MacOSX) + Flash FileList.browse() = problem
I have a multiple file uploader that uses Flash to open the file browsing windows. It was having trouble with Firefox on Mac. I put it on to the test. Everything works fine, until I load the jquery library in the same page. No functions nor anything, just loading the library gives me the problem. The problem arises when I open the file browser from Flash and then close it (either by canceling or selecting some files). Then, the flash movie loses all mouse events (which prevents me from opening new
change a page with jquery
hey, how could i change a page with ajax (jquery)? for example the header is going to stay fixed and only the content on the page will change, for example facebook; the header and footer (chat) are fixed but when browsing only the content between the header and chat are reloaded. thanks :(
get value from textarea and copy to a div
Basically I want to get the current value from a textarea field and copy to a div element on the page. Here is my HTML: <a href="#" class="desc-button">Edit</a> <div class="product-data"><?php echo $prod_description; ?></div> <form action="" method="post"> <div class="product-form" style="display:none;"> <textarea class="description" name="prod-desc"></textarea> <input type="submit" value="submit" /> </div></form> My JQuery code is as follows: $('.desc-button').click(function(){ $('.product-form').slideToggle();
how to hide the content between the div ?
I have the html code such as: <div class='one'></div> this is some content this is some content this is some content this is some content this is some content <div class='two'></div> Now the html can not changed. I would like to hide the content between <div class='one'></div> and <div class='two'></div> . Can u tell me how to do it? Thx u !!
String Response from PHP received by .post() as [object Object]
I hope someone can help me out here. I have a jquery script which sends a POST request and a simple PHP file which does the following: <?php if ($_POST["id"] != null) { $response = "Hello " . $_POST["id"]; } else { $response = "Unknown ID"; } echo $response; ?> The jQuery .post function is suppose to prompt the user with the response from the server but the alert prompt only shows [object Object]. Does anyone know what's wrong? Here's a simple version of the post() function .post("http://localhost:8080/testscript.php",{
Jquery1.2.6 $(document).ready() in Mozilla Firefox
I have now used Jquery1.2.6 Liburary in my website, but a question accured, I used serveral $(document).ready() method in my pages ,so the question is : it do work in first $(document).ready() ,but not work after the first. who can help me to solve it ? site:http://www.ehuayu.com
Add anchor to text inside table cells
Hi there, I'm kinda new in jQuery, used till today only jQuery plugins, but want to start using the jQuery itself. Suppose I have such a table: <table> <tr> <td>some text1. <br /> textToLink1</td> <td>some text2. <br /> textToLink2</td> </tr> <tr> <td>some text3. <br /> textToLink3</td> <td>some text4. <br /> textToLink4</td> </tr> </table> I want that the different textToLink inside a cell will convert to links anchors. How may I do such a thing? Notice that I don't want that all
How do I implement a Plugin/Extension?
I want to implement the jQuery GUID Helper plugin into my web app but I don't know what's the "best practice" method of incorporating it into my code. I'm basically creating a cart system from scratch (figured it was a sufficiently complicated system to use when learning jQuery). When the visitor first adds an item to their cart is when I wanted to create the GUID for the visitor. I have a cart-handler.js script that I link to from the item view page: <script type="text/javascript" src="/js/cart-handler.js"></script>
controlling an overlay via a handle?
Hi everyone. Longtime Javascripter taking his lumps on JQuery :D I grabbed an overlay routine from flowplayer and got that working (though I don't quite know how) then I got ambitious and added another dialog (duplicating their code) and bound it to a button. Works fine. Then I wanted to reuse the first dialog in an exception case during a function triggered by my new button... snafu time My second dialog triggers an overlay, then the first dialog triggers it's own overlay. I want to know if
XML response parsing crashes on strange Content-Type header (XOP)
Hello all, I have discovered the following problem (jquery 1.4.2). I use $.ajax to send a request to a XML-responding webservice. This webservice sends and unusual Content-Type HTTP header which leads to a parsing error and calling the error callback function. Normally, a Content-Type header looks like: text/xml;charset=utf-8 but this time it is generated with help of the XOP which implies sending binary data, so the HTTP Content-Type header looks like e.g.: multipart/related;start="<rootpart*8d077d6b-19a4-4725-9ee2-f87f841541ad@example.jaxws.sun.com>";type="application/xop+xml";boundary="uuid:8d077d6b-19a4-4725-9ee2-f87f841541ad";start-info="text/xml"
Issues with my toggle function. Please help!
A couple of things aren't working properly on my site—and since I'm new to writing jQuery I'm a bit mystified at what's going wrong. Problem I've got several links using the "sliderDiv" class, which should toggle the attached sliding function. However, the only link that works properly is the one in the sticky-footer. If you click "Contact", or "Featured Homes" in the navigation, you'll see what's not working properly. Also, if you attempt to close the slider by clicking the logo after the slider
Nested form tags?
So, my company provides javascript widgets designed to be easily dropped into peoples' pages. We ran into a problem where some of our widgets included <form> tags, and would break IE when inserted into pages inside a form tag (like ASP.net, which wraps the whole page in a form...), because you're not really supposed to nest form tags. Anyhow, we have some older widgets and some newer widgets, built on different underlying JS code. There are widgets from both generations that have form tags in them,
Newbie needs a simpler way...
I am simply trying to show some DOM elements that meet to criteria: 1) The id must contain a given substring and 2) The elements value must contain a given substring. The problem I am having is that I do not know how to put the selection criteria in the same expression. I need to do something like this, but don't know how: $(".user").children("td[id^='lastName'] && td:contains('xyz')").parent().show(); Thanks.
Disable preloading/mouseover effects
I am trying to use a jquery slider plugin, but every time I add the script to the html, the preloading effects in my navigation get disabled. Specifically, I have a swap image on load and a mouseover on load. Both do not work when I add the jquery code. It doesn't even seem to matter what jquery plugin I use. I have tried several and all create the same problem with my onload/mouseover effects. Does anyone have any idea why this is happening? Below is my html code. THANKS! <!DOCTYPE html PUBLIC "-//W3C//DTD
Getting response form elements to be recongnized afer $.post and serializing the form...?
Hello, I am sure there is a simple solution to this but have scoured the web and these forums for an answer. I am using $.post to post a form using Ajax but in the response there are more form items such as inputs and checkboxes that I would like to post on the next Ajax request. How to I get these elements to be posted on the next ajax call? My ajax post code is as follows: function ajx(div,pge){ $.post(pge,$("#myform").serialize(),function(data){ $('#'+div).html(data);
Basic ajax issue
Hello guys. My problem is that even though I have return false on the submit function, page still reloads while input type="submit". When I change input type to button, form does not get submitted even though I reference $('#former').submit Appreciate your help and thank you in advance. jscript code $(document).ready(function(){ $('#former').submit(function() { $.ajax({ type: "POST", url: 'post.php', data: $('#e').attr('value').serialize(),
jquery error() calls showing up in firebug profile
I am working on an ASP.NET application that make a lot of jquery and javascript calls and trying to optimize the client side code as much as possible. (This web application is only designed to run on special hardware that has very low memory and processing power.) The profiler in firebug is great for figuring out what calls are taking up the most time. I have already optimized a lot of my selectors and it is much faster. However the profile shows a lot of jquery error() calls. In the attached image
Insert preloaded image into table cell
How to insert a preloaded image into a table cell? This works fine to display a preloaded image: var image1 = $('<img />').attr('src', 'imageURL.jpg'); $('.somediv').append(image1); And this works fine to append a row to a table: $('.sometable tbody').append("<tr><td>col1stuff</td><td>col2stuff</td></tr>"); But this doesn't work to insert a preloaded image in an inserted table row: var image1 = $('<img />').attr('src', 'imageURL.jpg'); $('.sometable tbody').append("<tr><td>col1stuff</td><td>" + image1
radio menu
Hi, I'm using jQuery UI button(radio the 2nd option in examples) which work in Chrome and FF but not in IE. here is mij code: $("input:radio").click(function(){ var navval = $(this).attr('name'); alert( navval ); $.post("lib/PHP/sessionhandler.php", { menuselector: navval }, function(){ $("#menuDiv").load("lib/PHP/menu.php"); } ); }); in IE the #menuDiv doesnt get refreshed. what am i doing wrong?? Thanks in advance Frank
JSONP and asynchronous - capturing and returning response.
Hello, I'm having a nightmare. I've spent all day on this, and would like some help. I'm so near yet so far. If this is synchronous, normal json request, I can capture the result (data) and return it to a calling function. However jsonp is not synchronous. Whilst the data IS returned, and I can view it from within the success function, but I cannot access it after that. $.ajax({ url: remote_url, async: false, cache:
Dialog clone + datepicker
I have dialog clones that pull source from another file. I would like to have datepicker on these dialogs but I am not sure how to do this. I am able to do this on the regular dialog (non-clone) by using: <script type="text/javascript"> $(function() { $("#enddate").datepicker(); $("#startdate").datepicker(); }); </script> Can someone help me please?
$ is not defined error
hi guys i m new 2 jquery and i am using asp.net C# . i used accordian theme to display the main content of my page. so for that i included the necessary jquery files & css files in the head of my master file ..nd evn called the accordian function frm there. Jquery used to work perfectly fine for the previous pages creaded nd still works perfectly there .. but nw whn i m adding new pages ..firebug is throwing this error. my head in master page looks like: <head runat="server"> <title>Performance
Getting complete xml text from a node - XML nodeValue
Hi everyone, I'm trying to re-export a filtered set of XML data. For an input like this: <object> <header /> <thing1> <value1>1</value1> <value2>2</value2> <thing1/> </object> I want to do: val outxml = $('thing1',xmldoc).get(0).nodeValue; and get output like: <value1>1</value1><value2>2</value2> However, this currently returns 'undefined'. Is there any easy way to do this, or do I need to actually parse the XML below thing1 and manually write my own XML sub-tree? Jquery
ajax does not work with mozilla
My problem is that I need to develop an application with a database and for this I have to manage 3 forms or more and I am using ajax of jquery to manage data with php and jquery works very good hiding and showing the different forms, but the problem is that from third form with the button "Enviar" does not work longer overwriting the data that I consult on the div that I want but it returns to the first form and the strange is that with internett explorer works like I want, but I also need that
selector to check if a tag has any attributes?
In trying to select elements that have any attributes, the following throws a jQuery syntax error. $("div[*]") Is there a selector to check if a tag has any attributes? Tested with jQuery 1.3
Works from Firebug, but not from script (Moderation script)
I'm trying to make a moderation form for a user submitted site. I grab the submissions to moderate from the MYSQL database using PHP, and make a dynamic page with HTML like this- <html><head> <script type="text/javascript" src="scripts/jquery.js"></script> <script type="text/javascript" src="scripts/moderate.js"></script> </head><body> <div id="msg">Container</div> <table border='1'><tr><td>Name</td><td>Email</td><td>Location</td><td>Chemistry</td><td>Approve/Deny</td></tr>
prev().prev() !== prevAll('.eq(1)') ??
hi guys. just a short question. is prev().prev() not the same as prevAll('.eq(1)')? ive got a $('#xx).prev().prev() works but $('#xx).prevAll('eq(1)') not (the $('#xx') result in multiple results). i jst ask cause normaly i just use next when i want teh very next element and dislike chaining via next().next() - i think it looks better the way with nextAll('eq()'). greetings Stefan
Offset() - setting values issue using 1.3
I'm trying to set the offset position of a div using the following: $("div#search-filters").offset({ top: 500, left: 500 });For some reason, this isn't working - the other functions within the script are, so the script itself doesn't seem to be the issue. If I use the latest library release (1.4.2) this works fine, but I'm restricted to using 1.3 as it's managed by the Drupal framework. I'd eventually like to set the offset values using something like the example below, but for now, I can't even
Drag and Drop Clone problem
I need some help with the clone function using drag and drop. I am very new to jquery, so I'm sure I am just making a rookie mistake here, but any help would be appreciated. My application needs to be able to drag images from one div and drop them to another div that is the "droppable" area. These images once dropped must still have the ability to be draggable within the droppable area. I am also capturing the text from the image and saving it to a database. I have read many posts describing how
Accessing JSON data object via PHP script
Hey guys, I've got the following code: var data = { person: '<?php echo 'test'; ?>' }; $.get( '/scripts/script.template.php?id=1', data, processResponse ); I was just wondering how will I be able to access the content of the data variable in script.template.php? The other problem is that when I use the
Help needed in javascript validation on gridview control with check box using jquery
I have a question posted on asp.net forum http://forums.asp.net/t/1536752.aspx i.e I have a grid in which i have 4 columns checkbox, myid, mychildid, myidStatus All cotrols except checkbox are filled in templated label controls Below the grid i have two buttons CreateChild, DeleteChild When I click CreateChild I wanted to have a javascript validation function that if there is a checkbox checked in a row which already have mychildid field filled then it javascript validation alert. [as multiple child
using Jquery to get data in MySQL and put it in a textarea
Greetings, I´m Caio speaking from Brazil... and I start to use JQuery and see how is really simple...! I just have a question that I couldn´t find in documentation or here in the forum, and I will appreciate your attention to try to resolve it. First I have a PHP Script that is a combobox with a several textareas. What I would like to do is, select a data in combobox and it will get some data in MySQL database and put it the textarea inputs. The combobox is from name of persons, and the textareas
Next Page