.height() gives different values Chrome/FF/IE
Hello, At the moment i'm using this short piece of code $(document).ready(function() { $heightDiv = $('#colRight').height(); $('#colLeft').css('height',$heightDiv); }); When i'm alerting the $heightDiv i'm getting 3 different value's. Chrome: 139 IE: 779 FF: 781 The strange thing is that evrything is displaying like it should be in Internet Explorer. Any fix for this? Kind regards Zijkantje
delegate to all TDs without all with attribute enabled="false"
hello, i'm using this code: $("#mydiv tr:not(#tableheader)").delegate("td:not([enabled=false])", "click", function(){ alert($(this).html()); })but it doesn't seem to work. What am I doing wrong?
.each() -> mouseover on Elements
Hi everybody, I have 4 Images, which schould change their "src" by mouseover()/mouseout() jQuery( "#selecter img" ).each(function(){ alert ( this.id+jQuery(this).attr('id') ) ; jQuery( jQuery(this).attr('id') ).mouseover(function(){ alert ( jQuery(this).attr('id') ) ; jQuery( jQuery(this).attr('id') ).attr("src","dk_images/"+jQuery(this).attr('id')+"_1.jpg") ; }); }); <span id="selecter"> <img id="select_one"
Populating div with textarea content
I am trying to populate a preview div with the content of a textarea. I have 2 textareas on the page. One with ID compose and another with ID profile_signature. Each has its own preview button named respectivly #profile_sig_preview and #msg_preview. however no matter which button is clicked the div is always populated with the content of the first textarea ie profile_signature. I tired setting up 2 divs so the content could be seperated but that did the same thing. $j('#preview_msg_btn').click(function(){
Add/Remove class
I am trying to make a navigation menu that when a link is clicked, loads content into a hidden div, then shows the hidden div, then changed the class of the list item. If the same link is clicked again the class reverts back to what it was before and then the content div becomes hidden. Here is a url view-source:http://www.scottjraney.com/javatest/ Here is the Jquery $(document).ready(function(){ $("a.1").click(function(){ $("div#hidden").load("/javatest/content1.html"); $("div#hidden").slideDown();
Jquery Validate and submitHandler
Hi, I am using jquery.validate, when you specify a function for submitHandler, can you use it to call a method to for example do additional validation and then calling another method to write to the database? I have specified a method in my submitHandler, but I get the error 'invalid label {"d":0}'. Here is my code : $.validator.setDefaults({ submitHandler: function() { addUser(); } }); $("form").validate({ //errorLabelContainer: $("#divErrors"),
Help Me To Slide Down Automatically When Other contentContainer Clicked
Hi Guys, This Is The Tree View Structure.. Here I Need Help... While Expanding One Parent Structure All Others To Collapse.. Help Me In This.. Thank U In Advance... http://mediamilan.com/how-to-create-simple-tree-structure-menu-using-jquery-and-css/
Why does jQuery.parseXML ignore two of its parameters?
Recently I was reading through the jQuery code (jquery-1.5.2.js) and noticed that parseXML is declared like this (including the comments): // Cross-browser xml parsing // (xml & tmp used internally) parseXML: function( data , xml , tmp ) { ... } Inside the function, you will find that the parameters xml and tmp are overwritten before they are used. This means that they are effectively being used as local variables. Therefore, the function could have been declared like this: parseXML: function( data
AJAX call ending in error with Status 200 / OK - why?
ASP.NET 4.0 jQuery 1.4 While all seems well in my request and response I get tossed into the error callback rather than the success. I use Firebug to check the repsonse and it's: {"d":"Hello"} Client code: function GetStateCertifiable() { var AreaID = $("#listAllAreas").val(); $.ajax({ url: "../WebServices/AoP.asmx/GetStateCertifiable", data: '{"AreaID":"' + AreaID + '"}', type: "POST", contentType: "application/json; charset=utf-8", dataType: "json",
Wrap object tag into another div
I've trying this code: $("object").wrap('<div class="container" />'); but have no result. Any ideas?
Error on upgrading to jQuery 1.5.x
Are there any issues with using jQuery 1.5.x with jQuery UI 1.8.x?? Because we’re having issues upgrading to jQuery 1.5.1, Is this version not compatible with jQuery UI 1.8.x which we also use heavily? Here's the error we're getting: TypeError: cache[id] is undefined on this line of code: cache[ id ].toJSON = jQuery.noop; Thank you!
jQuery('[attribute$="value"]') - Doesn't work
Hi! I'm doing something like this: $('#Buttons li a').click(function(){ ... var ext=0; if($('this[href$=".html"]')) { ext=5; } else if($('this[href$=".php"]')) { ext=4; } window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-ext); ... The problem is that I'm clicking in a <a> with the href="test.php" but it never enters in the "else if" and I don't know why... Thanks for your time.
screen flicker using .show()
Hi there I am getting screen flicker during the .show() method under Firefox 3.6. This doesn't happen in FF4, Chrome, Safari and IE8. I have the div table size of fixed value (so no vertical resize needs to be done) of the divs (a list of 20 table items) operated on by the .show() (and .hide()) but still I am getting very bad screen flicker (the whole screen goes white for a second (or even two...) before refreshing which gives users a seriously bad headache). This flicker only seems to happen
Bug: jQuery.position() after css transform: Webkit & Firefox different results
// Assuming absolute positioning $myDiv.position({left:100,top:100}); // assuming we have a "transform" jQuery.CSSHooks for MozTranform and WebkitTransform $myDiv.css("transform","translate(50px, 50px)"); var newLeft = $myDiv.position().left; // on Firefox 3.6.15 // newLeft == 100 // on Webkit based browsers // newLeft == 150 Not sure which one is the right behavior (I prefer the Webkit result), but would be great to have jQuery normalizing it. Doing this in the application is very ineffective.
jqModal - Problem executing Multiple Triggers
Hello, jQuery Forum; I hope I'm in the right place I'm trying to use a jqModal Pop-Up to show product images from a list of thumbnail images on a main page, having difficulty getting multiple triggers to work. The first instance works fine, but subsequent instances show the same image in the pop-up as the first instance. I'm attaching the page code here, but it can also be seen at http://www.digifolders.com /jqModal_p rob.html . The page holds all the code elements required for the execution of
Using JQuery To Select and Option From a Drop Down Menu?
How can I do this with jquery. I tried this- $("#months option").each(function() { val = $(this).attr("value"); if(val == month) { $(this).attr("SELECTED", ""); } }); And it successfully added "selected" to the correct item. But it wasn't actually selected. How can I do this correctly?
Tabs based on the Day of the week
Hi, when the page loads I want to display both the div content and highlight the tab for the current day. I've found some code that loads the correct div based on the day but doesn't change the tab that's highlighted: $(function () { var tabContainers = $('div.tabs > div'); $('div.tabs ul.tabNavigation a').click(function () { tabContainers.hide().filter(this.hash).show(); $('div.tabs ul.tabNavigation a').removeClass('selected'); $(this).addClass('selected');
Superfish nav-bar menu level 3 inline display is not working
I can get the second level dropdown to display inline, but the third level stacks. Anybody have a solution for this?
How is $('<img/>') different form $('img')
I noticed this selector $('<img/>') I am wondering what is it really selecting? Is that different from the tag selector $('img')? And a piece of code: $sometihing.find('img').each(function(){ var $img = $(this); $('<img/>').load(function(){ //some function }).attr('src',$img.attr('src')); }); Why does it have to find its own " src " and give it to itself again? I appreciate if some can answer that for me.
$.fn.bind and fn.apply() problems on draggables
Hi, Not sure wether this should be here on in the UI (since it's revolves around both, feel free to move if you think I've posted it wrongly) I've been trying to wrap all my jQuery binds with try/catch using the source code found on http://pastebin.com/f579d999d. Demo on http://bivald.com/jquerydraggable.html It basically wrap everything in a try/catch letting you catch errors like this: $.handleErrors(function(e){ console.log("an error occurred"); console.log(e); }); However, this does
I would like something to "fall" from the top of the page to the bottom (and forcing a scroll)
I would like a little animation to "fall" from the top of my page and then fall to the bottom, forcing a scroll. Does anyone have any suggestions on what I should look at to start modifying to do this>
Error passing serialized array.
Im trying to pass a form that has an array of Importances in it. I can use the Jquery to pick up the form elements and serialize them, but having trouble pass the 'string' to a PHP script through AJax $('#form').submit(function(){ var impArray = $('#form').serialize(); var phpScript5 = 'update_KB.php'; $.ajaxSetup({ cache: true }); var ajaxPass6 = 'imp=' + impArray; var ajax_load5 = '<img src="loading-icon.gif" alt="loading..." />';
keeping accordion menu open when page refreshes
Hi there - I've been searching for a bit, but I cannot seem to find a solution to keep an accordion menu expanded when the page refreshes. I found some stuff with using $cookie, but I am not sure exactly what it would be looking for or calling in my code. Here's my code : <script type="text/javascript"> $(document).ready(function(){ $( '#search-nav > li > ul' ) .hide() .click(function( e ){ e.stopPropagation(); }); $('#search-nav > li').toggle(function(){ $(this) .css('background-position',
Question - call tag by tag inside the tag
Hello, if i have this code: <div id="newyork"> <div id="test"> Hello </div> </div> And bye $("test") I want call to newyork, how can I do that? somthing like $("test").getinsidetag();
a new loaded html elements can't be applied jquery function?
Previously, I already make this line of code $('#bank').click(function(event){ // request form $('#middle').load('form/bank.html'); $('#butang').click(function(){ alert("boleh"); }); event.preventDefault(); }); Which means, once after a link namely as "bank" is clicked,then it will extract the bank.html content into the middle div. And I already put a button ID named as "butang" over that bank.html. But why after the content is nicely rendered,
Need basics of adding Flexigrid to web app and configuring it.
I am very new to jQuery Flexigrid and almost as new to asp.net. However, Flexigrid seems to perfectly satisfy a need my team has. In my VS 2010 new asp.net web application I have 3 Scripts\jquery-1.4.1* files. I have spent a few hours on the web trying to find how to get from what I described above to a Flexigrid on my web app. As I said, I was very new to Flexigrid. A basic totorial would be a great help, but my searching has not turned on up. Thanks in advance, bigredweather
Is it possible to serve http content over https ? Jsonp doesn't seem to work for cross-protocol requests!
Hello, My web page is served over https and within it I need to serve content that comes from a normal http service. I have tried to use an .ajax() call with jsonp, but it would still throw a Security warning on IE that the content will not be delivered using a secure HTTPS connection. So does jsonp only work if you serve https content over http but not the other way around? Is it any other alternative? Thanks in advance!
css not applying to xml elements
hi, I'm trying to import some xml code and append it to some dom element, using this... [code] $.ajax({ type: "GET", url: "resources/xml/sites.xml", dataType: "xml", success: function(xml){ $('body').append($(xml).find('text').clone().contents()) alert($('#lol').length) }, }) [/code] sites.xml is: [code] <?xml version="1.0" encoding="iso-8859-1"?> <sites> <text><a id="lol" class="menu_a" href="www.google.it">ahuahauhauahu</a></text> </sites> [/code] the correct code ( <a id....></a> ) is appended
Unable to start using JQuery with IBM RAD 7.5.5
Hi, I have been using JQuery from last 1 year with IBM RAD 7.0 as IDE and WebSphere 6.1 as app Server without any problem. Now my development environment is upgraded wtih IBM RAD 7.5 and WebSphere 7.0 server. After writing the code in jsp within <JavaScript> tags as <script type="text/javascript"> $(document).ready(function(){ {); </script> i am getting the following error. The function $(HTMLDocument) is undefined I have included jquery-1.4.2.min.js and even replaced with jquery.min.js.
JQuery include an HTML file and its fade out?
Hello guys...! I'm a bit curious. how could we include an HTML file from jquery? Let's assume this story; Page 1: Has a link (once clicked it will execute something) Has a div (extracted from what it read from step above) Page 2: Only containing some Html elements Such as Table only. Page 3: Only cointaining some image elements Showing loading Gif file. The SOMETHING that I mentioned are these; 1) Read Page 3 content to show the loading gif into the div. 2) After couple seconds, then The loading
Scrolling to the bottom of a DIV
Hi - I'm grabbing some data (chat type application) from a web page (which just returns data queried from the database), and places it in a scrolling DIV element. What I then want to do is scroll to the bottom of the DIV, so that the last conversations pulled from the database, are shown (in the same wasy as Office Communicator or Instant Messaging work). My code below, just seems to scroll a little down the DIV and then stop - is there a way to get it to go to the bottom? Thanks for any help,
need to be solved: ajax post is too fassst.... and the page redirected.
Waah, wah, wah... I never realized that once I just putting in the jquery into my interfaces (jsp), it's going faster than ever...! I actually wanted to animate abit the button to be fadeOut once the button Login is pressed because i put that button inside of a form, I mean html form. But here, seems that the button fadeOut not completely, and it gets the response from the Ajax Post too fast... and it's redirected into another page (which is for this case; Go To Home) which in turns, I couldn't get
$.post() asynchronous return value problem
Hi, I am having problems with the $.pos() function returning an undefined value. I read somewhere that this is because the function returns the value before it gets a response from the server. I am not quite sure how to get around this... function addMediaCategory(name,parent_id) { $.post("addMediaCategory.php",{cat_name:name,parent:parent_id}, function(data) { if(data == "ok") { return "ok"; } else { return "error"; } },"text"); } function callMediaAdd() { var returnVal = addMediaCategory("Cat1",1);
How To Improve This Tree Structure??
Dear Friends, Here I Put The Link Of Simple Jquery Tree Model.. Kindly Read It And Give Ur Suggestions To Improve Myself And My Friends.. Thank u Guys.. http://mediamilan.com/how-to-create-simple-tree-structure-menu-using-jquery-and-css/
How to access data outside ajax callback
Hi, The answer to my question is probably very simple, but I'm having trouble making this work. I want to access a local csv file, rearrange it into an array, and use the data later in my script. The logic of this in psuedocode is: var massagedData $.get("myfile.csv",function(data){ massage the data here massagedData = the results }); ***Use the massaged data Since the massaged data are in the callback, they're not available at ***. I've tried declaring
[SOLVED] .live() attributes
I am having an issue with retrieving the attribute of an element that I have ajax'ed into my site, the following is the code that brings it in: $('a[rel=newpoint]').live('click', function() { jQuery.facebox(function(){ jQuery.ajax({ type: "POST", data: "city=" + jQuery("a[rel=newpoint]").attr("href"), url: "scripts/postforum.php", success: function (data) { jQuery.facebox(data);
$.ajax ahref variables
so i have eg <a href="#?name=kristof&id=1" class="send">Kristof</a> <a href="#?name=bart&id=2" class="send">Bart</a> $(function() { $.ajaxSetup({ cache: false }); var aanTladen = '<div style="color:#4DC2F9"><img src="load.gif"/> Searching for results : </div>'; $('.send').click(function(){ $.ajax( { type: "POST", url: "test2.php", // data: ({name : $(this).text(), id : $(this).text()}), data: ({id : this.getAttribute('id')}), success: function(msg) { console.log(msg); $('#result').html(msg);
using JQuery how to change text of select option?
I have such html code snippet: <select name="submitted-name" class="form-select day" id="edit-submitted-doum-tarihi-day" > <option value="" selected="selected">Day</option> <option value="1">1</option> <option value="2">2</option> </select> how can I change the text "Day" to "Month" with jquery?
Date picker
Hi, I use the jQuery datepicker to let a user pick a date that serves as a duedate for an action to be executed. Once the date has been picked and entered in a input box the date is stored in a MySQL database. This works fine! When the action is selected, the duedate value is retreived from the database and shown in the textbox. This is where the problem comes along, the inputbox is not displaying the date previous picked with the datepicker and stored in the database. How can I solve this problem?
getJSON Pound Sign problem
I've got a search application that uses the autocomplete plugin and ajax to query Solr via Spring MVC. If a user enters a pound sign it gets passed through to Spring via ajax ok, that is after I set Tomcat URIEncoding="UTF-8". Prior to this a pound sign came through to Spring with a capital A character with a carat above it in front. In another part of the application I am using getJSON to obtain some data, using the user input as part of the url. Unfortunately, when these requests are retrieved
Next Page