Nooob Q. jQuery is not working
Ok, this is a noob questions. I'm using Wordpress and have the following code. In the header I add: <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.2.6.js"></script> <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/test.js"></script> The test javascript contains: $(document).ready(function() { $("a").click(function() { alert("Hello world!"); }); }); function msg(txt) { alert(txt); } In my test php file I have: <a href="#"> test
[jQuery] jcarousel lite each li have own height
currently the plugin is set-up so that it calculates the height (offsetHeight) of the first li element and sets it as default height for the ol/ul and other li elements in carousel. each of my li is variable height and when i run the plugin it cuts of content. i'm wondering if anyone has a fix for the this issue. i would like each li to have height: auto, or to calculate the height of each li separately. my js skills are not ninja but I believe that i've identified the code in question: function
[jQuery] jcarousel lite each li have own height
currently the plugin is set-up so that it calculates the height (offsetHeight) of the first li element and sets it as default height for the ol/ul and other li elements in carousel. each of my li is variable height and when i run the plugin it cuts of content. i'm wondering if anyone has a fix for the this issue. i would like each li to have height: auto, or to calculate the height of each li separately. my js skills are not ninja but I believe that i've identified the code in question: function
[jQuery] TESTING: replicate event bubbling in tests
Hi, I was wondering how I could replicate event delegation while testing. For example: <div id="myDiv"> <scan id="myScan">hello</scan> </div> $('#myDiv').click(function(e) { $this = $(e.target) if ( $this.is('scan') ) $this.toggleClass("selectedScan") }); When I click on the scan in the browser, it works. But if I do this it doesn't: $('#myScan').click() Any help? Thanks, Nacho
[jQuery] Interesting on document ready question
Is document ready "actually" an event handler? Let's say I have $(function(){ }); $(function(){ }); $(function(){ }); $(function(){ }); $(function(){ }); etc ..... around 5000 of those. Will it actually degrade performance like 5000 bind()? My guess is not much performance penalty, but again, it's a guess.
[jQuery] Fastest way to clear child elements from a div
I'm using jTemplates to create a client grid, but I'm having trouble with load times. When I'm paging through the grid jTemplates is taking 4+ seconds to clear the grid and 2+ seconds to load it. I've got some work to do to make the loading time go down, but I'm worried about the clearing time. I've tried a few different methods, but nothing seems to be really fast. I'd like to be able to clear the div in less than a second. Here's what I've tried: $(selector).empty() and $(selector).html('') both
[jQuery] Unable to populate my div in Firefox
i m getting strange problem. i m unable to pupulate my div in Firefox Mozilla. but in IE i m getting no problem. i m using following function. function doData(p_id,cat,cat_id,first,last){ document.getElementById("doContainer").innerHTML=""; $.ajax({ url : "doData.php?p_id="+ p_id +"&cat="+ cat +"&cat_id=" + cat_id , success : function (data) { $("#doContainer").html(data); // this is not working in firefox } }); } $("#doContainer").html(data)
[jQuery] Select a line inside a <pre> tag
Hi, i'm working on some bookmarklets / greasemonke scripts to change some functionality in some websites. i got some code like this <pre> line 1 - aa line 2 - bb line 3 - cc </pre> and i need to select all lines that contains "aa" and "cc" does anybody have an idea how to do this?
[jQuery] Function called from a link - likely super noob stuff
Hi everyone, As the subject states, I'm sure the answer to this is on a super noob level - I'm just not exactly sure what I should be looking for here. I'm trying to plot points on a Google map using hcard information in my html. This part is working very nicely thanks to Simon Willison, however getting the code to add driving directions into the little popup marker bubble has been a little trickier. Thankfully, Mike Williams is a Google maps API monster with tons of tutorials, so I was able to snap
Calling a different video with every click on ordered list
Hi! Great to be back. I'll stick to one issue today. I'm using Neolao flv-player (http://flv- player.net) with swfobject, though I've tried it with Malsup media plugin. That's another subject kinda. CURRENT OBJECTIVE: to be able to click on any of the 'li''s in my menu and have a different video start playing or at least load, AND have the previous video stop and disappear. An example section of my menu is: <li> <a href="#landing" class="first">Third</a> <ul class="first"> <li><a href="#first-a">first-a</a></li>
Slide effects do not work in IE
I have several <table> elements and I want to slideDown() and slideUp() on them so only one is visible at a time. It works as expected in all browsers except IE 6 and 7: tables show and hide properly but there isn't any animation. A simple test case I wrote suggests that's related to tables not having assigned height: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript" src="/js/jquery-1.2.6.min.js"></script>
ajaxSubmit() with Quotes
I have been successfully using ajaxSubmit for a while but I never tested it with single or double quotes until now. And, it is breaking. Is there something that I can do about it? Is there a way to add slashes or something before submitting? Not sure what is best to do. Help?
[jQuery] what's wrong with $(":checkbox[checked=true]") ?
Hi, I was trying to select for checked checkboxes so I tried $(":checkbox[checked=true]") this never returns anything, even though if I select all checkboxes I can test "this.checked" for each one and it returns true/false as appropriate. I now understand that I can to :checkbox:checked, but I don't understand why my original approach doesn't work, since clearly each checkbox has an attribute 'checked' which has the value true or false. Andy
[jQuery] White circle appears before message box loads...
Hi, When loading the message box for the first time I get a white circle appear before my white box appears. I wonder if it is to do with the fact I am using rounded corners and the circle may be a mask, anyone else experience this? Code below: function showdiv() { $.blockUI({ message: $('img#displayBox'), css: { border: 'none', padding: '5px', backgroundColor: '#fff', '-webkit-border-radius': '10px', '-moz-border-radius': '10px', opacity: '0.9', color: '#000', width:
[jQuery] How to select one ID from multiple auto generated id?
Dear All... I'am new to jquery.... I have some problem. I have some link that have Id that auto generated from mysql query, till now I could not figure out how jQuery know what ID that i have clicked . For example: // The FORM $query = mysql_query("SELECT id,title FROM book ORDER BY id DESC"); <div id='result'></div> <div id='operation'/> while $fetch = mysql_fetch_array($query); { $id = $fetch ['id']; $title = $fetch ['id']; echo "$title | <a id='link_del$id' href = "process.php?do=dell&id= $id'
[jQuery] How do I delete the content of a cloned filefield?
Hi, all... and Happy New Year (a little early. US East Coast, 8pm)! I'm cloning a filefield, and, we'll assume, the user has already used the browse button to locate a file. When this filefield is cloned, the file path from the previous field is still in the new field. I want to empty the filefield. I tried this: $('.image-next :last').attr('value', function() { return this.value.replace(""); (The image filefields have the clas "image-next") But that didn't work...no errors, but content was still
[jQuery] FlyTabs : New Plugin
Hi everyone, I have released a new plugin called FlyTabs and would like to get some feedback. http://plugins.jquery.com/project/FlyTabs The purpose of the plugin is for a user to be able to create tabs on- the-fly that are cross-browser compatible. It uses the list method to create the tabs, so it is in line with latest Web 2.0 development trends. I created this plugin with the goal of requiring as little preparatory HTMLing as possible. In other words, 99% to 100% (depending if you create the hook
[jQuery] HELP: Screening questions for JavaScript developer candidates:
<p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 11.0px Times"><b>(required) Q: </b>Describe the difference in result of the JavaScript DOM methods getElementById and getElementsByClassName. <p style="margin: 5.0px 0.0px 5.0px 36.0px; font: 11.0px Times"><b>2. (required) </b>Given this JavaScript statement:<span style="font: 11.0px Lucida Grande"> <b> </b></span><b> objXHR.open('GET',</b><span style="text-decoration: underline ; color: #0000ff"><b>' HYPERLINK "http://" <a href="http://myURL.com">http://myURL.com</a>',true</b></span><b>);</b><span
[jQuery] jquery ui accordion - begin minimized
Hello all- As a newbie to jQuery, let me first say I'm terribly impressed. I like to think I've created a great project by using jQuery and the credit should go where it's due- the devs. Thanks guys! My question pertains to the accordion plugin. I have it fully functioning (I can post it if you need) but for the life of me I can't figure out how to make it so all of the menus stay closed when the page loads. I have 4 accordion menus on a page, and no one can have precedence over the others by starting
[jQuery] Superfish IE Pixel-Shift in vertical mode
Please view this URL using IE6 or IE7: http://www.postcardfromparis.com/. When hovering over the menu items that contain sub-level menu's notice that the next sibling of the menu shifts down 1-2 pixels when the sub- level menu is revealed. I thought doing this CSS would fix it but to no avail. #topNavigation ul ul { position: absolute; top: 0; left: 190px; display: none; } Any ideas? It's working fine in Safari, FF3, FF2 (haven't checked Opera yet). Best Regards, Nate
[jQuery] Problem link,href,tree, etc.
Hello everyone! My description: I have a field (type div), under which links links are available to some country's regions and loaded on button click. When I click on loaded data, I mean one of these links, region's districts are loaded. When I click on one of the districts links, spots (I named them-'miejscowosci') are loaded. There is a weird problem, because first data is returned correctly by a certain field, while when clicking next time, it jumps to the same page and looks like doesn't pick
[jQuery] OnDocument click handler not firing for php generated html
Ok, I am new to jQuery, and web development in genral, however I was wondering if somebody could show me the correct way of doing this. Basically I have a <DIV> in the body which gets it html (including links) from a post function in "$(document).ready(function(){" (due to different database user account will be able to see different links). However when one of these links are clicked, the "$("a").click(function (){" never fires (it does fire for hard coded links in <DIV> tags that are not received
[jQuery] OnDocument click handler not firing for php generated html
Ok, I am new to jQuery, and web development in genral, however I was wondering if somebody could show me the correct way of doing this. Basically I have a <DIV> in the body which gets it html (including links) from a post function in "$(document).ready(function(){" (due to different database user account will be able to see different links). However when one of these links are clicked, the "$("a").click(function (){" never fires (it does fire for hard coded links in <DIV> tags that are not received
[jQuery] $(document).ready fires before CSS is rendered?
I've got some links that only serve as anchors for javascript, so I use CSS to hide them like this: .requiresjavascript { display:none; } and here's the HTML: <a class="requiresjavascript clearall" href="#">Clear all</a> <a class="requiresjavascript clearall" href="#">Check all</a> The idea is that for a browser without javascript, those links don't appear. I want to show these links when javascript is available, so I have this in my $(document).ready() at the top: $(document).ready(function () {
[jQuery] UI tabs problem - ui-tabs-disabled class not being assigned
The class ui-tabs-disabled is supposed to be assigned to all but the selected tab, but it is not working for me. The selected tab is working great, and when I select tabs it reassigns the ui-tabs- selected class, so I know everything is set up correctly. Anybody have any ideas why the ui-tabs-disabled class is not getting assigned? Thanks.
[jQuery] writting plugin
Hi, i'm trying to write a jQuery plugin, i have read some posts, documents and other plugin code, but i don't understand the right standard to write a plugin. I found some patterns... == example 1== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; })(jQuery); == example 2== (function($) { $.fn.myPlugin = function(o) { return this.each(function() { // do something }); }; // private function function functionA () {..do something..}; })(jQuery); == example
[jQuery] JQuery calendar
Hi All can any one send me a demo of Jquery calendar i wrote this code in html <script type="text/javascript" src="/static_media/js/jquery.js"></ script> <script type="text/javascript" src="/static_media/js/ ui.datepicker.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".menu a").hover(function() { $(this).next("em").animate({opacity: "show", top: "-75"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-85"}, "fast");
[jQuery] live stats + setinterval
is there a better way to write this code to avoid server problem if the site gets a lot of visitors ? (keeping the "live" stats) <script> // the call for the update (it just change an entry in the db total = total + 1; function autoupdate() { $.post("count.php", {count:1}, function(data){ $("#counter").html(data); });} // the 1 sec interval $(document).ready(function() { setInterval("autoupdate()", 1000); }); </script>
[jQuery] method to tab when using dynamic form generation with jeditable
I have a table using jeditable within specific TDs. since the form is generated with js, there is no longer any tabbing between form elements. What method can i use to allow tabbing between TDs. i have a simple sample here http://www.roxstyle.com/projects/blssi/cms/de-tool/person.html#
[jQuery] validate remote question
hi there, im using the validate plugin to validate a form and in specific a dath of birth field. i think i will use the remote functionality to check to see is the date actually valid. that part is not a problem however what i want to know is , is it possible to send back different error messages like : 13 does not correspond to a valod month or please enter a year in the past etc, tnx sean
[jQuery] ie problems with jquery - xhr.open(type,s.url,s.async)
I've got a simple web page that works fine in FF, but chokes in IE, both 7 and 8. All pages are local, including popup.php. I am displaying tables with data from a mysql db - the tables display, but the error comes in when I include the function popup js code. The error is "permission denied, code0". the debugger leads me to line 28 in jquery - xhr.open(type,s.url,s.async). Again, this all works in FF (and Safari), but IE throws an error. Can anyone help me figure out what this is all about? [code]
[jQuery] Jquery Prbolem in firefox
$("#divid").html(data) function of jquery is working fine in IE7 and IE6. but in firefox it is not working. it is not giving me html output. Anybody can help me how to use it in firefox. my funntion is this. function doData(p_id,cat,cat_id,first,last){ document.getElementById("doContainer").innerHTML=""; $.ajax({ url : "doData.php?p_id="+ p_id +"&cat="+ cat +"&cat_id=" + cat_id , success : function (data) { $("#doContainer").html(data); } }); }
[jQuery] Jquery Tabs issue, linking to another tab from within the same document...
I'm having a problem with Jquery's tab plugin. Specifically, I've got a page with a couple of tabs. On that page, in one of the tabs, is a link to another tab. However, the link doesn't work. Additionally, I've noticed that on my main navigation, if I'm on the page with multiple tabs, and I click a link to a specific tab, it will not load. For example: The page is page.html. With in that page are 3 tabs, #tab1, #tab2, and #tab3. If within the div for #tab1 I want to link to #tab3 by using "a href="#tab3",
Hand Holding Needed: Get menu to do additional 'onclick's
Hi!! I have a menu that works and I need to have it continue to do it's menu stuff. I think I need to add a unique class to each <li> so that onclick I can call a single instance of my flv player code. Then, when I click a different menu <li> the first instance of the flash player is replace with a different bunch of code. This is my menu WITH a whole bunch of added class stuff. it DOES still work and the extra stuff is just so I can fumble around and try stuff. I have an empty <div id=video> just
[jQuery] Problem link,href,tree, etc.
Hello everyone! My description: I have a field (type div), under which links links are available to some country's regions and loaded on button click. When I click on loaded data, I mean one of these links, region's districts are loaded. When I click on one of the districts links, spots (I named them-'miejscowosci') are loaded. There is a weird problem, because first data is returned correctly by a certain field, while when clicking next time, it jumps to the same page and looks like doesn't pick
[jQuery] Problem link,href,tree, etc.
Hello everyone! My description: I have a field (type div), under which links links are available to some country's regions and loaded on button click. When I click on loaded data, I mean one of these links, region's districts are loaded. When I click on one of the districts links, spots (I named them-'miejscowosci') are loaded. There is a weird problem, because first data is returned correctly by a certain field, while when clicking next time, it jumps to the same page and looks like doesn't pick
Slightly Advanced Image cross-fade with preloader...
Hi all, I'm stumped. I'm trying to create an effect where 6 seperate images fade in 1 after another which creates 1 image, each number below represents an image...ie. 1-2-3-4-5-6 (image 1) 7-8-9-10-11-12 (image 2) 13-14-15-16-17-18 (image 3) so image 1-2-3-4-5-6 are 6 seperate images but load up to create 1 image (a cat or whatever), then 7-8-9-10-11-12 load up to create another image (a dog or whatever) on top of 1-2-3-4-5-6 and so on, hope this is making sense! and if pref i would like a preloader...
newbie
Hello from Sweden, I have some experience from protcolous, and wanted to try jquery. So, i created this simple script just to try the spimliest, but it does not work! the jquery.js-file is placed in the same folder as the script. The alert says "object Object". How come? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="jquery.js"></script>
[jQuery] Pass dynamic data to a JQuery Ajax function
Hi, My problem with JQuery (and JS in general) is that I do not know how to pass dynamic data to a function. I have a .click function that is assigned to a link. Here's the code: $(document).ready(function() { $("a.youtube").click(function() { $.ajax({ type: "POST", url: "ajaxtest.php", data: "player=youtube&id=1", success: function(msg){ $("div.player").append("Loaded" + msg); } }); }); }); The problem is that I need to pass dynamic data with
[jQuery] Button doesn't work in jquery dialog
Hi everybody I have a jquery dialog which loads an .aspx page and this page contains only a label and button controls the dialog opens and loads the page fine but when button click of that page has not been fired at all and generates the following javascript error: 'theForm.__EVENTTARGET' is null or not an object my code: jQuery(document).ready(function(){ jQuery("#Button1").click(function(){ jQuery("#myDiv").dialog({ modal: true, overlay: { opacity: 0.5, background: "black" },title: "Install Module"
Next Page