[jQuery] Should I test if an element exists?
I have a .js file that I wrote for my whole sites. Part of it only pertain to certain pages, so some of the selectors would not find anything on other pages. This file is included in all pages, so my question is, should I check if a selector exists first, before I run each script? I am thinking I could use: if ( $('#myDiv').length ) { // Run my scrip there }
[jQuery] JQuery XML Manipulation
Hello Developers, I am using jqGrid plugin of JQuery for displaying data in a grid. I am wanting to manipulate the data xml dynamically. For instance say I have an xml like <data> <emplist> <employee> <empcode>10</empcode> <empname>raj</empname> <employee> <employee> <empcode>20</empcode> <empname>caj</empname> <employee> </emplist> </data> Now when I say add row, I would like to add an data to the row (which I am able to do it). But I am not able to get the updated xml. For instance If I add data
[jQuery] Using variables in selectors? $("input[name=x]")
I haven't found any mention of this in the documentation. Can you use a variable in place of a string when using a selector to match an element in a page? If so, what is the syntax? x = foobar $("input[name=x]")
[jQuery] jAlert plugin help
Hi, I'm new to jQuery and I'm trying to set the focus back to a text field after a jAlert message. Here is the code I'm using. Any help would be really appreciated! function divCheck() { if (document.form1.First_Name.value.length==0){ jAlert("Please enter your First Name.", "Attention"); document.form1.First_Name.focus(); return false; } Thanks!
[jQuery] jquery.quicksearch not working in 1.3.2?
Hi, I'm in the process of upgrading a site from jQuery 1.2.6 to 1.3.2 and testing each of the plugins I'm using along the way. I've found that jquery.quicksearch ( http://rikrikrik.com/jquery/quicksearch/ ) fails silently (well, at least I'm not seeing a js error in Firebug). Does anyone know what might be causing the issue (or if there's a newer rev than the one at that page)? Thanks, Jack
[jQuery] jAlert plugin help
I can't seem to set the focus back to a text field after a jAlert message. This is the code: function divCheck() { if (document.form1.First_Name.value.length==0){ jAlert("Please enter your First Name.", "Attention"); document.form1.First_Name.focus(); return false; }
[jQuery] form.jquery.js
using form.jquery.js.whenthe formbutton isclicked the result that is suppose to comethrough into the target div is a bunch of jsonp code with script tags and jsapi....basically code that calls up a widget does anyone knowwhy this may not work? ive checked escaping quotes etc, i amwondering if there is anything else icould do..
[jQuery] Total Noob needs help please with emailing on clicking of links
Ok so I need some code to help me out here, I am not really a programmer by any means but do understand it to a point as I am mostly self taught. I mostly do HTML with CSS stuff and some javascript. I am looking to get some code to that will email someone ever time different links are clicked on a page. Basically to report back so someone can keep track of when educational videos are watched so we can keep track of total educational hours, its required by our company. I think if I read enough I need
[jQuery] Toggle class when radio checked
Hi, I just started using jQuery and am trying to achieve the below; Two radio button, when I click on any one the label for checked radio class should change, and when I click other one the label class should change here while the unchecked should fall back to default class. Below is the code I tried it applies the class but then it does not revert back to default when other radio button is checked. Any help is appreciated. Thank you! --------------------------------------- <!DOCTYPE html PUBLIC
[jQuery] [validate] "remote" not work in Internet Explorer
"remote" not work in Internet Explorer. See jquery-validate/demo/milk/
[jQuery] New plugin: jQuery.fader beta
Hi all, I customized the innerfade plugin from medienfreunde.de and added some navigation to it. Based on the number of slides it creates a "jumpToSlide" menu and normal "prev" and "next" navigation. The current slide indicator fades as well, which was important to keep the transitions nice and smooth. Please have a look at the following link: http://philipf.alphacomplex.org/plugins/fader/demo.html It is my first shot at a proper plugin and there are still a couple of glitches which need fixing.
[jQuery] Ajax Update
Hello Everyone, I am doing some research on JavaScript library, concentrating on jQuery / MooTools and Prototype JS and I was wondering what is jQuery's equivalent to Prototype JS's Ajax.Updater. A simple method to update an id selector; this nav contains an "active" class to highlight and deactivate the button. When a new button is selected, the new gets "activated" while the old gets "deactivated" ==== var url = "update_nav.php"; var pars = "active=thisbutton"; var myAjax = new Ajax.Updater("nav",
[jQuery] Alter URI, but do not load a new page
Hello everyone, I was wondering if it is possible to alter the URI without loading a new page. For example, when jQuery records a click on a link, it not only slides down a certain div, but also alters the URI in the address bar from example.com/about-us/ to example.com/about-us/link1/ without trying to actually load another page! The main usage for this kind of functionality is linking to example.com/about-us/link1/. If a user clicks this link, jQuery should automatically show a certain div rather
[jQuery] Superfish "current" color
I'm using a horizontal (nav-bar style) Superfish menu. I have a white background with black text in the nav bar. When I hover over it, it changes to green background with white text. The problem is, when I am not hovering over a menu item (i.e. I am in the sub-nav, or nowhere in the menu) the "current" item's text goes back to black. This creates black text on a green background... I'm trying to get it so that no matter what, it will always be white text on a green background. I've tried: .sf-navbar
[jQuery] jScoll Pane and Hidden Divs
I have a hidden div that uses the .fadeIn() function when a link is clicked. Inside this is a div that uses jScroll Pane. But, for some reason when I hide that parent div first, jScroll pane won't work. It seems like it might not be initialized inside a hidden div. Is this true? Any ideas on how to get this working? http://67.207.148.241/exhibitions (Mouse over Exhibitions) Thanks!
[jQuery] [autocomplete] Skins
Does autocomplete support skins from jquery-ui? TIA, Andrea
[jQuery] $(byName) <> $(byClass) in 1.3.2
hello, i'm new at using jQuery and i'm trying to create dynamic content. the problem is thant i can't retrieve the new content by name. here is an example to reproduce what i'm saying. (function() { fn = function() { $('.widgetBar').append('<div class=\'acc1\'></div>'); var acc = $('.acc1'); //var htmlText = '<a class=\'widgetBasSelector basic\'>Hola!!</ a><div class=pp name=\'div1\'></div>'; var htmlText = '<a class=\'widgetBasSelector basic\'>Hola!!</ a><div class=pp name=div1></div>'; acc.append(htmlText);
Alter URI, but do not load a new page
Hello everyone, I was wondering if it is possible to alter the URI without loading a new page. For example, when jQuery records a click on a link, it not only slides down a certain div, but also alters the URI in the address bar from example.com/about-us/ to example.com/about-us/link1/ without trying to load another page! The main usage for this kind of functionality is actually linking to example.com/about-us/link1/. If a user clicks this link, jQuery should automatically show a certain div rather
[jQuery] jqGrid - display a xml node attribute value in a cell
I need to display a xml node attribute value in a cell. How can I do it using the xmlmap? I have XML like: <rows> <row> <cell1 attribute1="Arun Boppudi" /> <cell2>2</cell2> <cell3>3</cell3> <cell4>4</cell4> </row> .......... </rows> In the table's first cells I need to display Arun Boppudi, 2, 3, 4 values respectively.
Adding images to a div
Hello, I'm currently building something in jQuery with which I can click on an image in one div and add it to another. This works with the following code; $("div#images_all a:has(img)").click(function() { $($(this).html()).appendTo("div#images_select"); return false; }); This works fine the way it does now but I'd like to have some additional features. I'd like to remove an image added to the "select div" on doubleclick and before adding an image to the "select div" I want to check if it hasn't
Get id of current element...
Ok I've got a simple script where I'm trying to let users click an item in a list and it'll load the relevant div in a separate document: $(".file").click(function () { var currentId = $(this).attr('id'); $("#content").load("content.htm currentId"); }); Now currentId is designed to match the ids on the list element, ie: <ul> <li><span class="file" id="div1">First News</span></li> </ul> Can anyone tell me why this doesn't work?
[jQuery] simple function not working on IE
Look at this : http://andriel.info/checkout/checkout2.html When I click continue button (on the left side). It has to open a div under the billing information. But on IE it doesnt work, FF is fine. This is the script function navigation(id) { id2 = id - 1; $('#content'+id2).hide(); $('#content'+id).show(); $('#title'+id).removeClass(); $('#title'+id).addClass('check_head'); $('#title'+id2).removeClass(); $('#title'+id2).addClass('check_body');
change text on label based on toggle?
Hi All. I have a div that is either shown or hidden via the toggle function and controlled by a click event on a label. What I am trying to do is change the label text to display either "open" or "close" based on whether the div is shown or hidden. Having trouble pinning down the syntax... have pasted what I have so far below... Many thanks in advance! <script type="text/javascript"> $(document).ready(function(){ $('#lblpi').click(function () { $('#divpi').toggle("slow"); var lblpi = $('#lblpi');
[jQuery] JQuery Form Validation & Fancybox
You'll have to forgive me if this question sounds easy but I am fairly new to jQuery so I'm still learning things here. I'm trying to do the following: -Display a signup form with the Fancybox plugin (working) -Validate the form, currently using the bassistance Validation plugin (working) -Dynamically check a MySQL database, via AJAX, to see if the username is already taken (????) -Once the form checks out then I want to upload the information to MySQL The problems I am having right now are as follows:
[jQuery] Rotating Highlighted List items
Hello. I have used a featured content gallery that I fund [URL="http://css- tricks.com/startstop-slider/"]here[/URL] as a gallery on [URL="http:// www.bonsaibranding.com/riverstone/gallery.html"]a website Im working on [/URL]. I would also like the navigation/list to change with the pictures. I understand in my head how it should work but Im struggling with the jquery. What Im trying to do is increment a variable up every time it changes over and tell the the list to highlight it using that but I
[jQuery] Treeview Menu
I am having a little problem with the plugin on IE7. Have googled as much as I could to try and find the problem however cannot seem to find an solution or mention of except for a one year old post on the owner's web site. The problem is that in IE7, the expanded menu will briefly show then collapse quickly on page load. This problem does not show up within the standard compliant browsers such as FF or Safari. http://www.precisionwoodproducts.com/index1.html is the test page. I'm actually a noob
[jQuery] SuperSubs behaving strangely in Superfish Joomla extension
After deploying the Superfish Joomla extension which went smoothly, I decided to activate the Supersubs feature as I wanted variable submenu widths and for the submenu items not break into two lines. Also, I don't currently have access the CSS and JS files so I can't manually edit the values etc. I couldn't get consistent behaviour between each menu item and also across browsers. When it's activated, I get some submenus that have long items that are wrapping onto two lines and others that have long
[jQuery] the hash option in localscroll plugin doesn't work in safari
Hi, I did use localscroll as the plugin in order to scroll to specific part of the page. It work very well in ie7, FF3 and chrome. However not in safari. It will work fine in safari only when you have 'hash' as 'true'. If someone can solve this problem please help me. Thank you
[jQuery] jquery for expand and collapse
below is my function , this function expands and collapses div with id 'collapsible_div_outer'. this works fine for a page just with one div , need suggestions on how to make this generic so that where ever i call this function i will pass the id's, please help me modify this function to pass parameters <code> <script type="text/javascript"> function test(){ if(jQuery("img#collapsible_indicator").attr("src") == "/audit/images/plus.png") { $("#collapsible_div_outer:hidden").slideDown("fast");
[jQuery] How to synchronize ajax events
Hi All, Here is a simple fragment: function zipSearch(){ var zip = $j('input#zip_entry').attr('value'); validateZip(zip); alert('second '+validation); ........... ............ } function validateZip(zip){ $j.post("markers.php", { validate: zip}, function(xml){ validation = $j.xml2json(xml, false); alert('first '+validation); }); } The problem is that the first function (zipSearch) calls validateZip and doesn't wait until it gets callback data from php
$(document).ready() not being called in IE
I have a very simple problem (seemingly). In FireFox this works fine, it loads the tab. In IE, this doesn't work. The tab doesn't load. There is a javacsript error, but its unrelated. I'm wondering if that is blocking the script? $(document).ready(function() { setTab(0); } Any clue? Why won't IE cooperate?
[jQuery] Add value to input
Hello, In a form I have a select (S), a button (B) and an input (I) among other form elements. I would like to add the value of the select, when the button is clicked, to the end of the text that is currently in the input. How can I do this? Thanks, Miguel
[jQuery] Cannot capture resize event on anything BUT the window
I have a scenario where i need to detect when the content area of the browser changes size. Now, normally one would just attach to the window's resize event and be done with it. But, this does not work when something on the page causes a scrollbar to appear. The window never raises and event since the window did not change size, just its content did to make room for the scrollbar. So, my next attempt was to hook into the body resize like this: $("body").resize(function(){alert("resized!")); But unfortunately
[jQuery] Sliding list items won't stop sliding
Hi, using jquery 1.3.2. I am going to dig through the docs more on the JQuery site, but while I do that. I am trying to animate a UL of items. I want the user to mouse over the header and have it expand. Sample page is below. Just have to change the path to jquery-1.3.2.js. It works, sort of in FF and IE. There are two problems that I haven't been able to resolve. First and foremost. If you mouse over a bunch of selections quickly, they all start to expand. If you stop your mouse, they continue to
Trouble with Youtube embed codes and AJAX
I'm working on a site that uses client video testimonials, but there's limited space to work with. I decided to try building an ajax function to reload the embedded video onclick, but it's not working. The code (embed html + quotes) is generated by a seperate PHP script, and this function does replace the code just fine: function newtestimonial() { $("#testimonial").empty(); $("#testimonial").load("http://path/to/testimonials.php"); } However, the video itself doesn't load. A View Source confirms
[jQuery] $(byName) <> $(byClass) on dynamic content
hello, i'm creating dynamic content in a page, but when i use the $ function to retrieve the new content, i'm can't find elements by name here is an example to reproduce the behavior (function() { fn = function() { $('.widgetBar').append('<div class=\'acc1\'></div>'); var acc = $('.acc1'); //var htmlText = '<a class=\'widgetBasSelector basic\'>Hola!!</ a><div class=pp name=\'div1\'></div>'; var htmlText = '<a class=\'widgetBasSelector basic\'>Hola!!</ a><div class=pp name=div1></div>'; acc.append(htmlText);
[jQuery] UIblock is disabling my modal form
Hi all hackers. Its my first Jquery project and I need to dim down the browser window and display a modal micro site where one of the tabbed pages is a form. I am using UIblock to try to achieve this but its blocking a little too much: I cant type into the text fields, it is disabled by the UIblock. I have the main modal container set to absolute with zindex 10000 (yeah im generous like that). Does anyone know how i can unblock the form? thank you! Pelle
[jQuery] Change background of table row based on column's value
I am totally new to jQuery. I wonder if it's possible to change the background color of any row in the table below where the value of the table cell belonging to class "numericColumn" is greater than 90? The values in this column will always be numeric. Thanks for any help, Lars <table class="importResults"> <tbody> <tr> <td>0</td> <td class="numericColumn">66</td> <td>No significant changes</td> </tr> <tr> <td>491</td> <td class="numericColumn">1</td> <td>Failed DPV because of invalid primary</td>
simple if-statement question
i want to make an if-statement that checks if the div is a certain width (either by class or id... doesn't matter) then executes the code if, for example, the div (named "top") equals 130px... how do i write the syntax? thanks in advance!
help get code to work in safari
I'm a javascript and jquery newbie. That said, the following code works in firefox/opera/camino but not safari 4 (beta) and I'd like to know why. Is the code correct? The form (id = myform) submits to an external site (different domain) but upon submit posts information to a local file (save.php). In safari it does not make the request to save.php. $(function () { $("#myform").submit(function() { var inputs = []; $(':input', this).each(function() { inputs.push(this.name +
Next Page