jquery

how to avoid crawler to follow anchor empty link (with jquery action)

Hello, I have in my site some links that are just used to display informative popups. For example I have something like : <a href="#" id="myLink">show more info</a> And in my .js file I have something like : $(document).ready(function() { $("#myLink).click(function() { displayPopup(); }); }); But google crawler or other ...

hide heading if no div below

I have some layers like so <div class="evenprop">some prop</div> <div class="evenprop">some prop2</div> <div class="evenprop">some prop3</div> <h3 class="otherprop">Other Props</h3> <div class="evenprop">some prop4</div> <div class="evenprop">some prop5</div> This is fine but I need to hide the "otherprop" class if the data looks li...

Change the tag but keep the attributes and content -- jQuery/Javascript

Hello! How can you get: <a href="page.html" class="class1 class2" id="thisid">Text</a> changed to <p href="page.html" class="class1 class2" id="thisid">Text</p> I'm familiar with jQuery's replaceWith but that doesn't keep attributes/content as far as I know. Note: Why would p have a href? Cuz I need to change p back to a on a...

find out if css of layer is block jquery

I'm trying to figure a way of finding out if a layer is displayed or not if ($('.property > .evenprop').css('display','block')){ $('.otherprop').show(); } else { $('.otherprop').hide(); } So something like if this is true <div class="property"> <div class="evenprop" style="display:block">blah</div> </div> The...

Can't understand why one of these solutions work and the other doesn't in IE8, works fine in FF.

Scenario: Drop down pre-populated, user can click to select items which refreshes content based on an array of id's obtained from anchors within a div. EDIT #1:- Okay okay, If I alert out items in the change event they will work in FF, IE alerts them out but just doesn't assign content to #panels as per the load content function. But, ...

Reloading page through javascript: avoid the "Postback" warning

I'm triggering a page reload through javascript, using the following: window.location.reload(true); However, in some cases (of previous postback), the browser is giving me the following warning "To Display the webpage again, the web browser needs to resend the information you've previously submitted...". Is there any way of avoing th...

Disabling xVal for Hidden Fields

In my MVC application, I've got a page where I use a few hidden fields to make some calculations under the hood. This page is loaded with xVal validations to make the data coherent. But the problem is that the xVal is also validating the hidden fields which are only used at the page itself. Is there any way of disabling xVal for hidden f...

ipad: jquery animation lags through onscreenkeyboard

I'm writing a webapp for mobile devices. The app includes some fancy pagination pageflip effect i've written using jquery.animate(), which works quite nice and fast in general. My problem on ipad: after the user clicked into a textarea / input text field, the onscreenkeyboard appears and the pageflip effect lags as hell. When i click ...

Jquery multiple each function inside click event

When clicking the I want this particular .parents ul to open and all other to collapse. Below code does not work for me. I think I do not understand how I use this and misuse e in the below code. <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="t...

find out if a id has certain text and then change it

I need to something like this if($('#ctl00_lblNoResults').text('Please select')){ $('.otherprop').text('Thanks') } else { $('.otherprop').text('No Thanks') } So i have a layer like so <div id="ctl00_lblNoResults">Don't select</div> And another bit of text <div class="otherprop">No Thanks</div> I need to change the text of "other...

creating a associative array/hash in javascript

Hi I have a form with different groups of checks boxes and trying to pass all the selected values into an array then pass that data into a ajax request. $('#accessoriesOptions input').each(function(index, value){ if($(this).attr('checked') ){ var newItem =[]; var obj = {}; obj[$(this).attr('value')] = $(this)...

Ajax callback refresh div

Hello All, I implemented a Ajax callback function to update a div (announcement) in my web page. It works fine, but the current issue is that the Ajax call function update the announcement div, however, after rewrite the content, the Javascript functions in this content are not load it. Therefore, my toggle function in table does not...

Fancybox: Show loading animation while loading iframe content

When using jQuery and fancybox for showing another page inside an iframe I want to show the loading animation while the page inside the iframe is loading. This is possible when using ajax to load content but I want the same thing when using iframe. Is it possible from the api to also get the loading animation while the content in the ifr...

PHP isn't saving session when it's an ajax call...

Hi all, i'm testing out a service for internal ads on our website... I need to save internal session (PHP) to know what ads have been displayed and some other protection stuff... The problem is that if i access to the API throught webbrowser GET or POST it does session (and saves the cookie of php session), but if i use jQuery.ajax() ...

calling a function in jquery issue

hi, I am trying to call my function loadPopup() although failing using JQuery v1.3.2. any suggestions? many thanks, $(this).find("a").each(function(i) { if ($(this).hasClass("selected") == false) { $(this).css("background-color", "#efefef"); alert(1); loadPopup(); alert(2); ...

How to add noConflict to a JS module pattern?

Hey, I use the following pattern in my JS: var lib = { module_one: { init: function () { ... } }, module_two: { init: function () { ... } } }; Question is, whats the best way to add: (function ($) { ... })(jQuery); I tried to put it around the var lib, but that di...

JQuery .wrap function problem

I can't seem to get this wrap function to work. Its not finding the class and wrapping it. Any ideas? Not sure what I've done wrong. Any Ideas? $(document).ready(function() { $('.greybox').wrap(" <div class='margin'> <div class='cont_wrapper'> <div class='border_top'> <div class='border_right'> <div class='border_bottom'> <div class=...

Ajax Auto-Lookup function for text box

I am designing a php page.In that i have text box.I want autofill (just like google search text box)option for that.I am new to jquery.I am slow in implementing.If anyone knw pls guide me.I want a simple code so that i can paste and check it.I surfed website.All are complex . ...

Retrieving the deselected node with jstree

How to get the deselected node in jstree. To me it seems that the domtree.bind("deselect_node.jstree", function (event, data) { }); gives access only to the selected node, so does the select_node event. Why? ...

Jquery SlideUp SlideDown - not fluid or smooth when is applied more then 1 div element with css3 box-shadow - why?

Hello all, What can we do in order to solve this issue. We are on the last Jquery using slideUp and slideDown on several div elements. If we have one, all runs smooth and fluid. If we have more then one, all effects are not at all smooth. If we disable box-shadow, all works as expected. So, the issue must be the usage of box-shadow +...