.slideToggle on a table row
Hi ! I'm a beginner with JQuery (and Ajax) and I have a little question with the slideToggle effect. I would like to develop a HTML table with some data and, when you click on a row, a row appears below the first and shows some details for the first row. I tried to do this : <button>Toggle</button> <table border="1"> <tr><td>1</td></tr> <tr id="toggled1" style="display:none;"><td>2</td></tr> <tr><td>3</td></tr> <tr id="toggled2" style="display:none;"><td>4</td></tr> </table> <script>
Getting no results using $.ajax in IE 7, 8, or 9... Am I missing something here?
Hello guys, I am building an app in Facebook and would like to pull in some Causes stats. In order to do this I am using jQuery and the ajax call. I am also using YQL. Here is what I have: <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script language="javascript" type="text/javascript" charset="utf-8"> //<![CDATA[ google.load("jquery", "1"); //]]> </script> <script type="text/javascript" charset="utf-8"> /* <![CDATA[ */ $(document).ready(function() { $.ajax({ type:
How can I check to see if a Model(MVC) is valid?
Hello Group, I am trying to check to see if a model is valid(without errors) when the page loads. Using VB.NET is there a way of doing this? Also, I am trying to do this in the .ascx page... i only see for the modelstate methods of Equals and referenceequals.... Here is the code I using which doesnt work... <% If ChampionTrees.Common.Models.PersonIndicator.Owner And Len(LTrim(RTrim(Html.Encode(Model.LastName)))) < 1 And _ Len(LTrim(RTrim(Html.Encode(Model.FirstName)))) > 1 And ModelState.Equals(True,
A small piece of code that doesn't work in IE*. Why might it be?
This small block of code doesn't work in IE8 for me: http://pastie.org/1623228 It works nicely in Chrome but not IE8. Here's the actual context I'm using it in: http://pastie.org/1623234 Any idea what's wrong?
.load() with VAR not working! PLEASE HELP!
Please can someone help with this simple problem! In this example, only the contents of a div called #business-services-info should be loaded in from the what-cms.php page, not the full page. Can anyone explain why the .load() event is ignoring my var (ahash) as the target div location to fetch the data from? http://ag-chartered-accountants.com/dynamic/page3.php#business-services-info The code: <body> <script type="text/javascript"> $(window).load (function() { var ahash = new String(window.location.hash);
Access proprietary XHR methods using jqXHR?
Hi all, I am developing for a proprietary browser (samsung tv) that provides a special method xhr.destroy() wich has to be called after every AJAX completed. My question is, is there any way to access this method (any browser proprietary method ) using jquery AJAX functions? Since they don't return the real XHR object, should jqxhr.destroy() work? According to the documentation: "jqXHR is a superset of the browser's native XMLHttpRequest object". I understand that all methods and properties of the
Execute .hide() after ajax page load
Hello I have a problem hiding elements after ajax respons. I have a JQuery script: $(function() { $(".tab_content").hide(); $("ul.tabs li:first").addClass("active").show(); $(".tab_content:first").show(); $("ul.tabs li").live('click',function() { $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".tab_content").hide();
.toggle() issue
Hi. I'm stuck with the following problem: <a id='bonus_details_link_1' href='#'>Link 1</a> <div id='bonus_details_1' style='display:none'>Details 1</div> <a id='bonus_details_link_2' href='#'>Link 2</a> <div id='bonus_details_2' style='display:none'>Details 2</div> <script type="text/javascript" src="jquery-1.5.min.js"></script> <script type="text/javascript"> $(document).ready(function() { elem1 = '#bonus_details_link_1'; elem2 = "#bonus_details_1"; $(elem1).click(function() { $(elem2).toggle('fast');
jQuery Plugin jquery.validate.min.js makes it impossible to get a JSON object!
I have an complicated error. I can't make a getJSON request WHEN i use the jquery.validate.min.js plugin Look for yourself on this playground site I made: Dead Link Anyone got an idea how I can still use jquery validate plugin BUT also make the getJSON request work? Thanks for any help! P.S. This is the problem I discovered during this discussion: http://forum.jquery.com/topic/getjson-problem The code on the playground site is the code DmitriiP provided.
Whi this code doesn't work
Hi every, I have this HTML code: <input type="text" name="product_description[1][name]" id="product_description[1][name]" size="100" value="" /> and then have this jQuery code: $(function(){ $("#product_description[1][name]").val("Something wrote here"); }); But the INPUT never is populated, why?
.replaceAll with a string
Hello, Me again, Is there a replaceall function for a string or array? How would it be used? Thanx, Ty
Click conditions?
I have a bit of a unusual situation and wanted to ask for advice on this: Here is my html body: <div height="500" width="500" id="outer"> <div height="100" width="100" id="inner"> </div> </div>and here is my jquery on document ready: $(#outer).live('click', function(){ //so something }); $(#inner).live('click', function(){ //so something });now the problem is that whenever i click on the div with id="inner" BOTH click functions are run. I need it NOT to run the "outer" function
Flash content keeps playing in inactive elements (in IE) - why?
i wasn't sure if i should post this here, under plugins or under UI, because it's true for everything i try (all of the above). i have flash content in hidden elements i'm showing and hiding (be it tabs, cycle plugin or any other plugin for this kind of thing). it works fine in every browser but IE... there, the flash videos keep playing when a different tab is chosen and don't restart as they do in every other browser. what am i doing wrong? is there a way to force the standard behaviour of all
$.getJSON problem
Hi, I ran into a problem with this piece of code: $('#your_songs').live('click', function(){ alert('1'); $.getJSON('yourSongs.php', function(data) { alert('2'); alert(data.links);when I click my button it alerts '1' then it throws an error = Uncaught SyntaxError: Unexpected token :(in crome) Invalid Lable(in firefox) alert('2'); is never fired. that puts the error into the highlighted line. And I know that line works because i have the exact same code in a different spot only the php file is different.
load image in background before showing
I was wondering if anyone knew how to load a image in the background and have the current image show until the new image has been downloaded and then swap out the image. I currently just have the replace without the buffering. Because of the download time of the new image there is a short time where the image space is blank. thank you
How to use an id and class in an .each function
Hello, Im trying to extract text data within a table row. Can I combine the id and class within the .each function. Do you have an example. Thank You
dropdown - get index of item with specific attribut
hi <select id="myselect"> <option value="a">test</option> <option value="b">test</option> <option value="c">test</option> </select>i need to somehow get the index of the item with value "c" (so it will return 2). how to do so? thanks
How can I get .blur( ) working in this situation?
I am having an issue with the .blur() event. I have a search box that, when clicked, will call a .focus() event that changes the background color and adds a "clear" icon. When the clear icon is clicked the text in the search box should be cleared out. When the user clicks back off the search box, the background color should return to normal and the clear icon should disappear. The focus and click events are working okay, but when I add the blur event it throws everything off. The blur event seems
Question about Ajax callback functions
I currently have several functions in my document.ready handler which are working fine. Two are designed to apply css styling to select elements: $('select.third').filter(function(){return $(this).val() == '1'; }).css({backgroundColor: 'yellow'}); $('select.fourth').filter(function(){return $(this).val() == '0'; }).css({backgroundColor: 'red'}); and another makes an Ajax call to change the sort order of the elements when the user changes a select element: $('select#searchtype').change(function(event){
delete element if checkbox checked
Im trying to delete an element if the checkbox inside it is checked. if($j(this).find('input[id^="checkbox"]:checked').length == 1) { var parts = $j('input[id^="checkbox"]:checked').attr('id').split('-'); $j('input[id^="checkbox"]:checked').each(function(){ $j('dl#row-'+parts[1]).remove(); }); });however it only removes the last element. Any ideas?
images within DIV change size according to window resize?
Hey, i have been trying for ages to find a way of making a series of images within one div resize according to the size of the users window or their screen resolution. Anyone know how i can do this? i know jquery uses the .resize function and am hoping i could give the div with images inside a function to change size according to the window size. any help is much appreciated thank you!
Ways to hanlde multiple dynamic input fields in form
Newbie jquery/html form question -- I have a set of input fields that can be dynamically duplicated/cloned or removed and submitted. I'm looking for a ways to configure the form for easy processing without having to loop through each input field inside the divs: <form action="dummy.php" method="post"> <div id="customer1"> Name: <input type="text" name="name1"> Addr: <input type="text" name="addr1"> Ph: <input type="text" name="phone1">
Writing mutliple fields via ajax
I've been using jquery for a while, and I LOVE IT! However, I've hit a wall on this one problem and I can't figure it out. Lets say I want to have a list of text fields - 2 items per row. Hypothetically, lets call it a shopping list app. The user comes to a page and sees 2 text fields - the product and the cost. They can enter something in, and save it. Or, they can click on "Add another row" and a new set of text fields will pop up below so they can add another product and cost. I know how to add
Text selecting is not working on browser
Hi All, i am using jquery first time on my page , one of my user reports me the bug that when he is trying to select something from browser its not working.i think this is a common scenario when user select something from browser and paste in google for serching purpose. Can anyone tell me what could be the possible reason of this problem?? Thanks in advance. Ankur
Click event on nested elements with same class
Hello everyone, I am making a system whereby if an element has a class "editable", you can click it and a popup box appears with some options about that particular element. Fairly straightforward, I'm using: <div class="editable"> CONTENT HERE </div> $('.editable').click(function() { // get the contents and do something with them in popup box }); This works fine but I need to be able to have lots of different divs, all with class "editable", some
Using Dynamic URL's with XHtmlRequest in jQuery
Hi, i use jQuery with the history plugin to fetch content dynamically. it works like this: <a href="#pagename">Page 1</a>this would be my call to fetch 'pagename.html' into a div labelled in an XHR call. anyhow, the problem. I need to fetch a page with a module, which would normally work like this: <a href="content.php?sort=country">Sort by Country</a>but due to me fetching content dynamically, i cant put a link like this as it would send me out of my page, and onto the page 'content.php' I was
Use of next() and parent() with next <table>
Hello, current state: html.html <div class=main> <p>bla<a id=hide>hide</a></p> <table><tbody>[..]</tbody></table> <p>bla<a id=hide>hide</a></p> <table><tbody>[..]</tbody></table> <p>bla<a id=hide>hide</a></p> <table><tbody>[..]</tbody></table> </div> js.js $("#hide").click(function(){ $(this).parent('p').next('table').hide(); }); I need to hide the "next" table. But with my given example above, it just works for the first <a> Element. In fact, if I press another the second or
Detect Touch Screens?
Is there a way to use jquery to detect any device with a touch screen? Im using the jscrollpane but the handles drag in the wrong direction on touch screens like the ipad (in my opinion). As you can drag the main content (which works in the correct way), I want to hide the scroll bars if the device is a touch screen. Thanks
jQuery 1.5.1 and Adobe Air
Greetings Everyone, I have been using jQuery for some time know with great success and today I decided to try my hand at creating an Adobe Air application in Dreamweaver. I made a simple html page (see below) with a button and a span tag to interact with. The page works fine when I run it thought Firefox but when I try to preview (or run it) in Air it doesn't work at all. I did some trouble shooting and discovered that Air is reporting an error when loading jQuery 1.5.1. The error is (which
.animate() question, can this be with pause?
Hi there, I have the following code form the api example: <!DOCTYPE html> <html> <head> <style> div { position:absolute; background-color:#abc; left:50px; width:90px; height:90px; margin:5px; } </style> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <button id="left">«</button> <button id="right">»</button> <div class="block"></div> <script> $("#right").click(function(){ $(".block").animate({"left": "+=250px"}, "slow"); }); $("#left").click(function(){ $(".block").animate({"left":
How to take snapshot ofdragged/dropped/resized image with background of esri map
Hi all, I am ne to JQuery forum and this is my first post. I am allowing users to draw a diagram on a div using jquery drag,drop,rotate .The esri map is the background for the images.Once they complete the diagram and click save ,the div needs to be saved as image[bytes] in database. Please suggest any applet or plugin to take snapshot of the client screen with provided 'height' & 'width' . I am using asp.net,JS,c#,IE7. I cant use any server side code like provinding the URL,because the area
Problems with .delegate() on table populated with .tmpl()
Hi all, I'm using jQuery 1.4.4 and I can't understand where I'm doing wrong, I'm simply populating all the rows of a table with template function, so far so good, but I cant delegate the "hover" (and click and all the events) event on a row or a cell. I've tried to put the .delegate() code also in the footer of my page but nothing. Do you know there are some problems? My code actually is: <script id="listTemplate" type="text/x-jquery-tmpl"> <tr> <td>${item}</td> </tr> </script>
Change Tooltip on mouseclick
Hi, I want to change the text of my tooltip on mouseclick. I got a button and over this button is a tooltip. Actually "open slider" - After I clicked that button there should be "close slider". My Code: <!-- Toggle --> <script> $(document).ready(function(){ $("div.changereport").hide(); $("div.trigger").click(function(){ $("div.changereport").slideToggle("slow"); return false; }); }); </script> <!-- Toggle --> <!-- ImageSwitch --> <script> $(function() { var $images
Saving a data structure to a file...
I have a JSON data structure that I'm pulling in VIA an AJAX call. What I want to be able to do is click a button/link and be able to save this data structure to disk, but I'm not really sure how to go about this. I've been experimenting with the following: The link has the following format "<a href='data:application/json, " + data_structure + "'>Click here!</a>" I've been able to replace data_structure with text and /json to /rtf, which gives me a pop-up 'SaveAs' dialog box, and when I open the
Making a drag/drop "gallery" with savable "cart"
Hi guys, This is what I want to achieve, but can't/don't know how to... A page with drag/droppable images. When an image is dragged to a "cart" (a div), the script gets the value of that image (say $30) and saves it to that particular uses "cart". When they refresh, the image remains in the cart. Images need to be able to be removed. Also, the values are added together in the "cart" to give a total. When if this total exceeds a predefined limit within the script, no more images can be added and the
Safe to upgrade to v1.5?
I am using jquery version 1.4.4 , i have read the release log said the Ajax have a big change. So do i need to change my ($.Ajax,$.post,$.get) code to make work with 1.5? Sorry for my bad english.
Read XML with jQuery
Hello, I am trying to get some values from an XML response for a Windows Sidebar Gadget but I failed so far. This is an example of the XML: <?xml version="1.0" encoding="utf-8"?> <response> <valid_until>2011-03-07 10:51:06.000997</valid_until> <data>2146259433</data> <sms>621</sms> <credits>14.28</credits> <sms_super_on_net>990</sms_super_on_net> <is_expired>False</is_expired> </response> And this is how I get it, it is through a common XMLHttpRequest working in every browser. var response = xmlHttp.responseText;
Doubt for exist bug (read JSON format)
I think that exist Bug at the JQuery . at the 1.5.1,check for read Json format with JSP file ,JQuery can't read this format. can you check it? for example : $.ajax({ url: "server.jsp", dataType: 'json', success: function(data){ alert(data.one); } }); jquery can't read Data in the "server.jsp".but at the : $.ajax({ url: "server.txt", dataType: 'json', success: function(data){ alert(data.one); } }); very easy read data in the "server.txt" file. Can you check it?
Fetch data in intervals but append not load
I'm trying to retrieve new records as they come in in real time. I have this so far, but as of now its replacing the span. I want each record to stack on top of the other as they come in <script> $(document).ready(function(){ $("#getrecords").load("x.cfm?u=1"); // Do data load every 5 seconds setInterval( function() { $("# getrecords").load("x.cfm?u=1"); }, 5000 ); }); </script> <span id=" getrecords"></span>
using jquery on documents pulled with .load()
Im using the pagination plugin and i would like to call jquery on the page that has been loaded with the plugin but cannot get it to work. for example: the page that is pulled: <a href="#" class="click">Click</a> using: $j('#hiddenresult').load('/mypage.php', null, initPagination); i want to do: jQuery('.click').click(function(){ alert('clicked'); }); but it doesnt work. If i include it in the file that is called using .load() then it works but i cannot use it because the file is a loop of database
Next Page