Replacing the html on a clicked button with closest()
I have this html and jquery <!Doctype> <head> <meta charset="utf-8" /> <title>Array Crud With Positions</title> <style type="text/css"> .container{ width:960px; } .krudSpace{ width:100%; } label{ width:15%; float:left; } .krudItem{ border:1px solid orange; background-color:pink; margin-bottom:2%; } button{ margin-right:2%; margin-bottom:0.55%; } </style> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> jQuery(function() { $("#button").click(function () { $("<div
Alternative to using wrapInner
I've having trouble with the wrapInner function causing some event handlers to be duplicated when used on divs containing a elements from 3rd party toolkit. Currently we're basically doing this: $('#someElement').wrapInner('<table><tr><td></td></tr></table>'); When someElement contains our 3rd party toolkit control, some event handlers are duplicated. This code seems to do the same wrapping without causing the duplicate handlers: $('#someElement').html('<table><tr><td>' + $('#someElement').html()
how to post the clicked element attribute with ajax
Hello, I'm trying to post variables dynamically with ajax. The code I have come up to until now is: $("#formid input").click(function() { var btnclick = $(this).attr("name"); $.ajax({ url: "mydomain.com", type: "POST", data: {id: "1", btnclick: "1"}, success: function(data) { $(".comres").html(data); } }); return false; }); The problem is that it is not posting the name of the clicked button but it must be posting btnclick=1 no matter what
Getting the content on a div using class name
I have my php script return this huge html http://jsfiddle.net/thiswolf/H8HTX/ but i am only interested with the content of the div with the class name one. This is the code i am using on success success: function(html){ var ifilter = jQuery(html).find('.one').html(); alert(ifilter); } The code does not filter as i would have wanted.
what is the jquery function to hide words that exceed a certain number.
hi everyone what is the jquery function that will enable me to count the number of words in a statement and then select the words that exceed a certain amount. i will explain further. i only want the first 1000 words in a statement to show and to then hide the rest using the .hide() function. what jquery function will allow me to do this. thanks eveeryone for your help. warm regards Andreea 115
How to get the height of each tab-Jquery dynamically
Hello everybody! I was wondering how to capture the height of each tab-jquery. I am using a tab-jaquery on my site, each tab has a different height according to content. I need a script Jquery to get the height of each tab when I click on each tab individually. The scheme is the following: I have a variable that will store the height of the tab, this variable will be updated and receive the height of the tab that is being driven by the user. It is similar to that http://jsbin.com/emera3/4 when I
Jquery won't post my form
I am having this simple code which i want to use to posts some form to a processing script. <!Doctype> <head> <meta charset="utf-8" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> jQuery(function() { jQuery('.sliderSave').live("click",function() { var dasvalue = jQuery(this).attr("value"); jQuery("input[name='dashidden']").val(dasvalue); jQuery.ajax({ type: "POST", url: "exchange.php", data: jQuery(".aj").serialize(), success:
Trying to create a megamenu - hacing problems with loops
I am learning javascript (and jQuery). I cannot figure out how to make my megamenu work correctly. The script is taking all of the bins (list items underneath the top UL) and putting them underneath the very first menu item. To futher illustrate, when the page lodes my menu items look something like this: <ul> <li>Top Level Menu Item 1</li> <li>Top Level Menu Item 2 <ul>Bin A <li>Link 1</li> <li>Link 2</li> </ul> </li> <li>Top Level
complex binding situation
Hi all profs outside there, I (relative beginner query) have a quite complex situation I have to resolve and couldn’t come through it: Thats the function: function appendTitles() { var titles = ['title_1','title_2','title_3','title_4']; $.each(titles, function(index,title){ var selwork=title.substr(6); $('#foldout').append("<img id = "+title+" class='titles' src='images/"+title+".png'></img>") .children().bind('click', {work:selwork}, workChoice) } ); } What I tried here was: 1) in the first part
using in php
hi bros how can i use jquery in php to tranistion to pop up page thnx http://www.scripters.info
SimpleModal onOpen/onClose
Hey Guys, I'm currently using the SimpleModal jquery plugin from: http://www.ericmmartin.com/projects/simplemodal/ At the moment, i have got it working so that it opens and closes without any fadeIn or fadeOut dialogue elements. This is the current code that I have working without the fadeIn or fadeOut. jQuery(function ($) { // Load dialog on click $('.basic').click(function (e) { var id = $(this).attr("href"); $.get('extra.php', { fixture: id }, function (data) { $('#content-one').html(data).modal({
obstrusive script
Hi all, does anyone has an idea how this obtrusive set of scripts: <!--Menu title list--> function appendTitles() { var titles = [1,2,3,4]; $.each(titles, function(index,title){ $("<img id = 'title_"+title+"' class='titles' src='images/title_"+title+".png'></img>").appendTo('#foldout') .bind('click', function(){ <!--change to work in response to title choice--> var work = $("#gwork").val(); $(".work_" + work).fadeOut(950, 'easeOutSine', function() { $(".work_"+ title).fadeIn(950, 'easeInSine');
Jquery delay
Hello, i want to apply a style to div with a class="project-hover" for a delay of 3 secondes, then remove the style : i use this syntax, but it seems incorrect, plz help: $(document).ready(function(){ $('.project-hover').first().addClass('activer').delay(3000).removeClass('activer'); }); /************************** HTML Code ************************************/ <li class="project-hover activer"> <a href="#" class="show-actualite"><img src="./images/actualites.jpg" alt=""></a> <div class="details">
Create iframes from original page content
I am trying to dynamically "rewrite" an entire page to a set of iframes. I want a music player bar at the bottom iframe and the original page "rewritten" in an iframe above/behind that. Almost just like SMC player. I feel like I'm close but I am a jQuery novice.. So any pointers will be greatly appreciated beforehand. Here's the main part that creates the iframes that's not working correctly. var oldpage = "<html>" + $("html").html() + "</html>"; $('body').html( "<iframe frameborder='0' id='content'
ads before flash game using jquery
hello .. every one i'm looking for know how to make like this kind of ads using jquery http://hi10.net/Play/Game/1164 look to the link you will find google adsense .. before ads then when click on close he going to start use game i think it will use Next(); In Jquery OR HIDE / Show .. Any One Have idea plz Guide me thxx صور
css height incorrect
First time using this forum... I have an app written in jQuery that reads the css height of a div box with variable amounts of text in it. The css height is set to auto and most of the time the css height read by jQuery is correct. However I have found a problem when the text on the last line results in no spaces at the end of the line. eg it fits exactly within the width of the div box. When this happens the css height is what would be expected if the number of lines of text was one extra than actually
Processing XML from a URL without specifying a xml file?
I enter the follow url in my browser exactly as shown here: http://srv-two-dev/raw/ and I receive the following data: <raws> <raw id="*" > <rpn></rpn> <desc></desc> <datecreated></datecreated> <status></status> <mfgven></mfgven> <mfgvenpt></mfgvenpt> <mfgvendesc></mfgvendesc> <distven></distven> <distvenpt></distvenpt> <category ></category> </raw> <raw id="*1234" > <rpn>2 Mil Plastic</rpn> <desc></desc> <datecreated></datecreated> <status>STOCK</status> <mfgven></mfgven> <mfgvenpt></mfgvenpt>
How to select an element that has the same id attribute value, as the class attribute value of another.
Hello There, I have an area map, and some hidden divs that each correspond to different sections of the area map. When the user clicks a section, I'd like the corresponding div to fadeIn(). The area map sections have an identical class to the id of the relevant div. Could someone help me match them up with jQuery so the correct div fades in, here's what I have so far.. $("area").click(function(){ var county = $(this).attr("class"); var id = $("div").each(function() { $(this).attr("id"); }); } );
AJAX with Jquery?
Is ajax using jquery faster than normal ajax request? some of my scripts seem to be responding slow.. so I wanted to know if there is any difference in speed and performance between old fashion ajax requests and using jquery to make them? Thanks!
append not added to DOM when called inside click function
I am sort of muddling my way through teaching myself jQuery, and I've finally run into a wall that I can't get around. I call append() on an element in the DOM, adding a new element inside it. I make a click handler for the new element, and everything works fine. But when I call append() inside a click handler, the resulting element is not recognized by my selector, and I'm guessing it's not actually added to the DOM. Here's my simplified code; hopefully you can make sense of it: <head> <script
Problem with concurrent Ajax loads...
Hi, I've been trying to troubleshoot a problem that occurs on every browser (Chrome, Safari, IE) other than Firefox. I have a page that initiates 3 loads after the DOM is settled. Each load is done from within separate script tags throughout the page and the response is placed inside of a span tag located just before the script. Here is an example of one of them: <SPAN id="currentutil"><IMG src='/gif/loading.gif' align=middle /> Processing...</SPAN> <script type="text/javascript"> $(document).ready(function()
'\0' unicode character appearing at end of javascript files
So this isn't a jQuery specific question specifically but i've been wrestling with the for the past day and a half. I have a javascript file in my app called main.js that when the browser loads it from the the virtual centos server I have on my MBP it adds a bunch of '\0' unicode characters to the end of the file and doesn't load the whole file, usually stopping somewhere randomly near the end. I've verified that there are no extra invisible characters in the file. If I rename the file and link
How to change a css class with using jQuery and a .click function
Hi jQuery Forum, First off , you and I have something in common... we like to learn new technologies... it makes life different and fun and it feels new... My Q is about a doc that I have. I have assigned a css class to an anchor or link...in the .css file. I am looking to make this link change its css style from the orignial to a new css style. I must be rusty because ... I attempted to use .addclass ... to the link... Now ... I am an unlucky guy whom sometimes finds things
Load XML via AJAX - IE8 not working
So I have this newsfeed system which works perfectly on all browsers..... except IE8! Surprise! Now, the code I have was made by trial and error, so there might be some obvious coding issues which I don't know... Here's the external JS file (I use jQuery 1.7.2 btw) $(document).ready(function(){ $.ajax({ type: "GET", url: "newsfeed_en.xml", dataType: "html", success: function(xml) { $(xml).find("element:first").each(function(){
Removing td from drop down menu
Hi: I was a web developer in the 90's but am now a high school Social Studies teacher - so my skills are pretty rusty. I'm trying to help out the school with their Canvas (Instructure LMS) implementation. I'm trying to completely remove the second column called "Managed Accounts" from the "Courses" drop-down navigation menu. We have to do this from a JavaScript file - it cannot be changed on the server. However - the second column won't always be present. Some users get that column and some don't.
jQuery $.inArray() always return -1 with an array of object
I have an array of object, that contain columnNames. when i check if a particular columnName exists it alwayz returns -1 Here is an sample http://jsfiddle.net/trLkt/6/ Help will b appriciated, Thanks :)
jquery delegate method
I want to know that this example fires on second click not at first click, why? i am using delegate function. the example is http://jsfiddle.net/3avaG/. I need this solution badly. first click does not show 'ok' message, after second and so on, do as like, Actually i want to do as like, first click do something and second click do another, But problem is the tag in example appended by append() method when some another event occur successfully. So i need delegate() method. Thank you.
don't display a div
I've create a empty <div> ( without every text ) but this have a style like as background-color and ... Now I write when writing code inside <div> not been shown at all. thank for help.
Returning a deferred object from a deferred objects callback?
I´m desperate! I have asked around but couldn´t get any help. This is what i am trying to do: http://jsfiddle.net/Rm9KR/ Note that: document.write(d.state()+"<br>"); d.then(function(){ document.write(d.state()+"<br>"); },function(){ document.write(d.state()+"<br>"); }); Will never run. since i try this from the function: error: function(data,status) { document.write('ajax done: fail'); dfd.reject(); return dfd; } I try to tell the caller that the Ajax call failed (or succeded).
change menu item when user is login
Good morning to everybody, I have this menu: <li><a>Area login</a> <ul> <li><a href="#">Registrati</a></li> <li><a href="#">Login</a></li> </ul> I would like that it changes when user has been login: <ul> <li><a href="#">Chat</a></li> <li><a href="#">Logout</a></li> I control if user is login with php instruction: if(isset($_SESSION['mail'])) ........ Please can some one help me to realize that? Thanks in advance Tegatti
jQuery animate delay issues with self -queued looping of steps
I have a simple system for looping animations in place. This works, except if the queue is cleared, and restarted the delays don't delay for so long. Can someone tell me if this is a bug in my code, or jQuery? I reported the problem in detail on stackoverflow: http://stackoverflow.com/questions/12300378/jquery-animate-delay-issues-with-self-queued-looping-of-steps Thanks, Chris
JQuery equivalent for XML parsing
var doc = document.implementation.createDocument("", "", null); // create an element, giving it an explicit XML namespace var elem = doc.createElementNS( 'http://www.w3sc.com/abc', 'abc' ); // add the element to the doc (the document was empty so this element becomes the root element) doc.appendChild( elem ); // now serialize it -- this code is also specific to standards compliant browsers var str = (new XMLSerializer()).serializeToString( doc ); alert( str ); Can some one Please give me JQuery equivalent
HtmlUnit tests works with jQuery 1.7, does not work with 1.8.1. What could have affected it?
I have a suite of tests that works very well on a web application using jQuery 1.7. This week jQuery was updated from 1.7 to 1.8.1. Now it seems nothing works. Using 1.7 there was no need for waits() all over the place, it seemed to synchronize great with the ajax. With 1.8.1 I need waits, and on many pages it seems unable to catch the redirect. HtmlUnit even sends the right requests, but it just doesn't seem to update the page itself with the responses (even though looking at all responses, it does
IE8 Submit click HTML realtime update/refresh issue
Hi, I'm new to the forum and have signed up after a day of ripping out what little is left of my hair. Basically, I have some relatively simple code that makes use of a sjax (rather than ajax) call (it has to be done this way because of an issue with an upstream provider). On the surface it's a simple sign up form, the user clicks submit, a feedback div is filled with a message 'please wait', the sjax call is made and upon return the 'please wait' is replaced with a success or failure message. The
autocomplete off not working!
Hello why can't I get the code below to work? $('.city').attr('autocomplete','off');Link to the page that I use it (Search hotel location) Thanks
How to combine these two JQuery Function with else or else if statement, Lost little here!!
I am trying to write these two function into simple else statement, where once validation is good and complete, page loading jquery begins. Please guide, I tried a few things, none seem to work as need. [code] <script type="text/javascript"> /* <![CDATA[ */ jQuery(function () { jQuery("#oldpassword").validate({ expression: "if (VAL.length > 5 && VAL) return true; else return false;", message: "Please enter a Current Password" }); jQuery("#password").validate({ expression: "if (VAL.length > 5 && VAL)
.on() maybe a stupid question but please do help [edit - SOLVED]
I have a page with a div that I put the result of an ajax request which contains a <select> So in the said page I load a javascript file that contains a .on() listener for the select from the ajax request that is to be loaded on the div, but this doesn't work! I tried using .live() on the external js and it does work and I tried using .on() on the ajax page itself and it also works.. so why when I put it in a external js that is loaded to the page that contains the div that the ajax result would
Getting the location of a Superfish Menu Element
Hello! Is there anyway to get the height of a still hidden element? Basically, I'm using a vertical Superfish Menu and need to find the height of a submenu element before it gets clicked. Thanks so much, -Eric
problem with fancybox
hi, i try to ad by my pictures a link: this.title += '<a title="1st title" class="fancybox" href="http://domain/image.jpg">Link</a>'; = works fine this.title += '<a title="1st title" class="fancybox" href="http://domain/index.php">Link</a>'; = does not work. it loads the page on top. i would like the link in the fancybox. what can i do?
Warning messages
Hi, I have a site that is working fine. I have a "flip" transition and as it happens, I see some warning messages inthe background that I cannot even read. How can I find out what they are?
Next Page