Calling Javascript After Web Method has fired - How?
Hi all, I'm trying to implement the cascading dropdown from the asp.net ajaxtoolkit. I need to get the count in a sub category dropdown, if it's zero then I turn off the visibility of the sub category. If I use the javascript OnChange event then my script fires before the web method, so I need to know how to fire my script AFTER the web method has fired please. I've been told that I can use jQuery.ajax() method, but Im unsure of the syntax, could anyone help me out please? My demo page: http://bit.ly/92RYvq
Displaying hidden div
Hi All, I have a div "nav3" that in the css, I have assigned display:none, to initially hide it. Just before I animate it, I need to re-display it and was trying to use the following line: $j('#nav3').attr("display", "inline"); $j is set to noConflict. Could you tell me what's wrong with this line? or a better command to use? Thanks, Bill
Issue applying click actions to jQuery-created elements
I have been having issues with the .html(), .append() and .prepend() functions. If I attempt the following code ... $('div').append('span id="clickme">click me</span>'); ... then try to run the following function ... $('#clickme').click(function() { /* do something here */ }); ... jQuery doesn't seem to register the click. Is this a known bug? Is there a way around this?
Best solution for a "dynamic submit form"
Hi. I´ve just started using Jquery, and are very impressed :) Now I have this problem and I dont know the best solution for it, so I hope you could point me in the right direction. On a page I am working on, I have this form where users can sign up. It is a signup form for family gymnastics. When the user (a parent) submits the form the data entered in the fields are stored in a database. The problem is, that the user shall have the option to add 'x' number of children. So when the user clicks an
Ajax Post Simplification?
Is it not possible to post all form fields without having to specify them (eg. like a normal http post)? Surely if you have a largish form this is not very practical? Are there any inline methods that can be employed that don't require the data to be passed like this? $.ajax({ type: "POST", url: "some.php", data: "field1=blah&field2=blah", success: function(msg){ } });
galleriffic jquery plug-in customization.
I have installed the gallerific plug-in into my site, and it works perfectly. (http://www.twospy.com/galleriffic/) However I am trying to customize it. I am using it as part of a shopping cart to show product images, and I have a dropdown box on the page to select color of each product. I need the gallerific gallery to react to the drop down menu (onchange?) and switch to the correct image. Within the jquery.gallerific.js file there is this code that controls the gallery. It basically says whichever
Adding class to all divs not containing an element
I need to add a class to every div (with ID #myDiv) NOT containing an <li>-Tag. I have: function checkEmptyDiv() { $("div #myDiv").each(function () { if ($(this).find("li").length == 0) { // $(this).addClass("hasNoLi"); $(this).parents("div:first").addClass("hasNoLi"); } });}Line 5 doesn't add the class to the div. Any suggestions? Thx
Validate disabled field?
I've got a field which is disabled and is populated through a popup. The user clicks a link, selects a user and the field is populated with that users value. Since it is disabled they can't manually type a value into it. I'm using Jorn's validation plugin and am unable to validate that field - nothing happens :\ <input type="text" name="myFieldName" id="myFieldName" value="" disabled="disabled" /> Whats the best way to handle something like that? Jim
Animated messages after Ajax action
I am calling a php script when a modal dialog is closed. Once the script executes I want to display a success or failure message and reload the ui tab that the modal was launched from. I can do all of it aside from the sucess or fail message. I can get the php script to echo some html, but this is immediately overridden when I reload the tab. I can ammend the php script to send a variable if needs be. This is what I have so far: $(function() { var current_id; var $ajaxdata = $("#ajaxdata");
Problem with IE7 when added callback function to plugin...
I added to one pluggin callback function and it stoped working on IE7 but working on Mozilla can anyone check it out http://www.lifestyletelevision.tv/customScroller.1.2/2/examples/ajax-menu-example.php Callback name onContentLoaded... Anyone can solve this problem on IE7?
backgroundPosition plugin callback
Hi there, I'm trying to repeat the effect for the other tr inside the callback function after the effect finishes for the current tr $('tr:eq(0)') .css( {backgroundPosition: "0 0"} ) .stop().animate({backgroundPosition:"(-1950px 0)"}, {duration:1500, complete:function(){ //repeat the above for the other
Dynamic URL after modal/dialog confirmation
I am very new to JQ so please be gentle! I have a table with edit and delete buttons on each row, I have managed to get modal dialogs working with the following code, the links that invoke the dialog each have a unique ID like so: <a href="#" id="1234" class="dialog_link">Link text 1</a> <a href="#" id="5678" class="dialog_link">Link text 2</a> When the dialog is closed I need to call a PHP script to actually do the delete bit and I am stuck on that! $(function() { $(".dialog_link").dialog("destroy");
get tag text from xnl data
thanks in advance for any help provided this is vexing me no end, because it should be simple as pie… i can get this to work in opera but in explorer it doesnt. I have a xml file that I am trying to parse… <item> <title>title to get</title> <description>text to get…</description> <enclosure url="url to get"></enclosure> … </item function(data){ if(data.results[0]){ //if there is data $.each(data.results, function(index, value){ //for the first 2 results if (index<2) { //append the value to the results
Add select options only if option doesn't already exist
Hi - I have two multiple selects on my page. One gets updated via ajax whenever the user filters data (we'll call that select "#select-1"), when they select options from that it then gets moved into the other select (we'll call that "#select-2"). That is all working fine but I'd like to refine it so that they can't select the same data twice. So, basically, what I'd like to do is add logic within the ajax call to only update the select options in (#select-1) if it does NOT exist in the other select
Ajax get method
Hello, I have this function : function compt(id, file){ $.get('compt.php', { idsup:id, fileup:file }, function(data){ if (data == '1') { $('#dl').empty(); $('#dl').append('telechargement...'); }; else{ alert('Problème de connexion à la base de donnée');
Hide then FadeIn image once loaded
$('img').hide(); $('img').load(function(){ $(this).fadeIn('slow'); }); Pretty simple.. basically just want to hide images until they are fully loaded, then have them fadeIn once they are loaded. I researched a few of the ways but I wanted to see if having the script this simple would still be an option. Am I running into problems by having it this simple?
function is not defined when using setTimeout?
Hello. I have this code: setTimeout("urlcode()",2000); which runs on a click event, it runs on the click event but i get this error in firebug: urlcode is not defined It should call this function: function urlcode(){ //My code here }; But if I just call the function without the setTimeout then it runs the function. What am i doing wrong? Thanks.
selecting content in jquery
hello, I want to select the contents of a span in jquery. this is the html: <a href="?page=home&action=add&id={$film.film_id}"><img src="images/shoppingcartButton.png" id="shoppingButton" alt="shoppingcartButton" title="shoppingcartButton"/><span>{$film.film_id}</span></a> the jquery i have is: lalala = ($('#shoppingButton span').text()); alert(lalala); but the result is empty. anyone know how it should be done? tyvm
jQuery.browser and jQuery.browser.version issue
Dear jQuery Team, I can understand your thinking about jQuery.support and in many situations there is obviously recommend to use it instead of jQuery.browser, but please notice, there is still high (critical) need to have ability to precisely identify user agents. I think this is very uncommon bahaviour of jQuery.browser.version that in Firefox it displays e.g. 1.9.2.8 instead of 3.6.8. Browser version means clearly not version of Gecko engine (if you want this feature go ahead, but please put it
ProgressBar for Downloading a Single Large JPG
I've seen lots of progressbar information out there, most of them for uploading, or downloading multiple files. However, the site I'm working on requires a single large JPG (~950KB) at a time. I don't want to preload the file because I have so many of them (it's a photographer's site). They wanted a progress bar at the to show the status as it loads the image, then I'd .fadeTo() the image. Can you use jQuery or PHP, or both to get the status of downloading a file like that? Thanks!
non-asynchronous page request using both get& post parameters
Hi, I have some trouble with my app. User enters his login&pass, they are being checked on server using ajax, and if they're ok, i wanna open new page, which'll set cookies and session vars, but i have an universal script, and I need request something like universalScript?mode=login (mode is GET) and some POST parameters such as login and pass, besides it must be new page, not ajax, Some ideas?
More fluid scroll button
Hey everybody. I've only recently started using jQuery and I was wondering if there was a built in function to scroll a button. Basically I have one of those right-hand side blog buttons that fallow on scroll. What I need is a function that could possibly give me a delay from when I start scrolling the page and when the blog button starts fallowing. Any simple answers out there? Cheers.
Sliding box content problem
Hi, I've created a sliding box that when you click on the 'a' the content slides from right to left and disappears. http://spencercoons.com/projects/twitter_hide/ but the problem is that the copy inside the div starts to wrap underneath itself when the box slides over. I tried an 'overflow: hidden' but couldn't get any result. I'm a novice at javascript in general so any help would be really appreciated! Thank you.
Jquery AJAX data show after a interval in php
I am a beginner at Jquery. What i want is to display the data using AJAX in a step by step manner. So let say if in my database there is a table "DATA" with a field name "info" having multiple rows as a data info ---- 1 2 3 4 5 Now i want to display all the five rows but after a certain delay of time let say after a second. So i want to use Jquery with AJAX to retrieve data from mySQL table and display each row after a second. Please provide an example for solving this problem. Thanks in Advance...
getJSON Function Not Entered - Not Working
The GetCats function is called. However, when it return, the getJSON function is never entered. I have tried several ways. Am I doing something wrong, or is my JsonResult invalid? Thanks. From Controller Class: public JsonResult GetCats() { // enters and returns fine List<ListItem> list = new List<ListItem>() { new ListItem() { Value = "1", Text = "VA" }, new ListItem() { Value = "2", Text = "MD" }, new ListItem()
jQuery is kidding me?!
hi folks, i try to make a form with jquery... it looks like this: var d = jQuery(document.createElement("div")).attr("class", "message").append(a); var c = "<input name='1' type='text' id='1' />"; var z = "<input name='submit' type='submit' id='submit' />"; this.container.append('<form action='' method='post' id='login_form' />').append(d).append(c).append(z).hide();and when i look with firebugs/firefox to the source, the code looks like this: <form id='login_form' method='post' action=''></form>
AJAX user validation
I'm creating an AJAX user validation so that when a user types in a username, it checks it in the database to see if it exists. I want it to execute after the user finishes typing. I've tried using: $("#username_field").keyup(function(){ which works, but I don't want a query executed every time the users presses a key. I was wondering if there was a better way to do it. Meaning I what the check to be preformed after the user finishes typing. Thanks, Zeeshan Syed Web Programmer http://www.bdqworks.com
When 2 buttons are blocked unblock other
How to? 1.When two buttons will be blocked because of my before actions how to unblock another one which is blocked?(red & green) 2. How to recognize what image is in div already using hasclass or something else? Pciture related. http://i31.tinypic.com/15rnjia.png Sorry for my english.
Select LI only if it has a UL for a child
I have a list (simplified version example) <ul> <li><a>Grandfather</a> <ul> <li><a>Father <span>Desc</span></a> <ul> <li><a>Son <span>Desc</span></a></li> <li><a>Daughter <span>Desc</span></a></li> </li> <li><a>Uncle <span>Desc</span></a></li> <li><a>Another Top Level <span>Desc</span></a></li> <li><a>Final Top Level <span>Desc</span></a></li>
Answer - injecting radio buttons in webkit
This appears to be an issue with webkit and not jQuery specifically, but I've noticed this: NewDomRadio = '<input type="radio" checked="checked" id="testme" name=" testme" />'; $('div').prepend(NewEnumDom); will not work in Safari (I'm using 5.0 w/ Snow Leopard). Chrome appears to have somewhat fixed this, although destroying and recreating the element a few times re-introduces the bug. The source will read "checked=checked" correctly, but the DOM inspector reports checked:false. There seem to be
jQuery & Ajax
Hi Developers, I'm having a small problem while using Ajax. Well, this might not appear as jQuery problem, but any advice will be appreciated. I've a dropdown list displaying problem IDs in my page. Based on the ID selected, the problem statement (HTML code fragment) is loaded from the database, and displayed in another <div> using $.load(). There is absolutely no problem with this. The problem is, I'm using SyntaxHighlighter to highlight the problem statement (C code). This highlighting thing is
Get text which is between some signs
Hi, I have a value which contains sth like this: "200x200(+100.00)" ...and now I want to get that "100" value and set this as a new variable. My target(100) is between sign + and . Any idea?
Jquery IE error
So, was wondering if anyone could solve this one for me, not too familiar with JQuery. I downloaded this vertical flyout menu using JQuery and it works fine in all browsers 100% except for IE. In IE, it gives me an error: Microsoft JScript runtime error: 'parents(...).0.$settings' is null or not an object The area of code that it breaks in is this: function getSettings(el) { return $(el).parents('ul.jd_menu_flag_root')[0].$settings; } So, it seems the parent settings of the menu is null. And I noticed
Help with cross-browser issue
Let me start by saying this script works in Chrome, but not FF or IE. In FF/IE, the form will submit but the data will not post. Here's the javascript: <script type="text/javascript"> $(document).ready(function(){ $("form#tweet_form").submit(function() { var tweet = $('#tweet').attr('value'); $.ajax({ type: "POST", url: "sidebar_right_tweet.php", clearForm: true, data: "tweet="+ tweet, success: function(){ $(function(){ $('div.success').fadeIn(); $('div.success').delay(2000).fadeOut('slow'); });
Narrative Javascript
On a project i got stuck on this "problem" When you make a json (ajax) call. You also need a callback function. Which means I have to call the next $.getJSON within that callback function to read the next portion of data. In my opinion this is not very readable code... What I want is a nice and readable piece of code. Where you could just write it like this: var data1 = $.getJSON(..); var data2 = $.getJSON(..); I've found a solution here: http://neilmix.com/narrativejs/doc/overview.html (explains
Setting maxlength in Firefox & Opera
Hi guys, Setting maxlength attribute of input[type=text] or input[type=password] does not work as expected. In Firefox and Opera if maxlength is not set the field.attr('maxlength') == -1. But if I try to set field.attr('maxlength', -1) it is being set to 0 instead. Please find attached example. What is the best way to proceed with it? UPDATE: Attaching files does not work for me so here is the link to it http://gist.github.com/476690 Michal
jquery $.ajax() post to ASHX file and lost session variables
I am posting, via .ajax() to a an ASHX file which is unable to retrieve session scoped variables -- even when I implement the class using IReadOnlySessionState Is this due to the AJAX post not containing cookie with the session id in it? is there a way to ensure that this data gets to the ashx? I dont want to have to pass in the data via the ajax call itself (ie form captcha verification) any help would be great. thanks,
:contains - exact match and case insensitive
I'm using this function to make the :contains selector case insensitive and it works great. $.expr[':'].icontains = function(obj, index, meta, stack){ return (obj.textContent || obj.innerText || jQuery(obj).text() || '').toLowerCase().indexOf(meta[3].toLowerCase()) >= 0; }; Is there any way to combine the exact match function with case insensitive function that I'm using? $.expr[":"].econtains = function(obj, index, meta, stack){ return (obj.textContent || obj.innerText || $(obj).text() || "").toLowerCase()
override html()
[I posted this on the Developing jQuery UI forum as well, but perhaps it is more relevant in this forum since it is about the html() method...] Is it possible to "override"/"hook"/"replace" the html() method on particular elements, and if so, how? Or, are there any events raised when the html is changed by a call to html()? The reason I am asking is that I would like to detect when html() is called on an element in order to do some pre-processing before the html is changed and some post-processing
jquery ajax call works in Firefox not in IE7
I have the following function at the end of a (php) webpage: function flagDocRead(currentdocid, currentuserid){ alert(currentdocid); alert(currentuserid); $.get("./blocks/rc_importantdocs/flagdocread.php",{ docid: currentdocid, userid: currentuserid }); } currentdocid and currentuserid are both integers. IE7 fails with "Object doesn't support this property or method". Thanks in advance for any advice.
Next Page