jquery

jQuery - getJSON data to array

How do you store the data received from jQuery getJSON to an array for later usage? Here's a sample snippet - somehow the loop's data is not being stored to the global haikus. $(document).ready(function(){ var haikus=[]; alert("begin loop"); $.getJSON('http://haikuennui.com/random.php',function(data){ var i=0; ...

Is it possible to fetch values using smarty, php, JQuery from another page ? [ No Cross-domains ]

Hello, I am working on smarty template files. core php of that template engine are encoded with ioncube. So I am restricted to get certain values on certain pages only. For Example, I get value of {$clientemail} only on clientareadetails.php on clientprofile.php value of {$clientemail} is null So, Is it possible to fetch values...

Problem posting file through jquery in asp.net mvc

I want to check file size and file type when someone choose a file from file upload so for that i use $('#fuEnglish1').live('change', function () { var form = $("#form11").serialize(); var myurl = '<%= Url.Action("CheckFileSizeandType", "Media") %>'; $.ajax({ url: myurl, type: "POS...

What is the correct syntax for `.live()` binding of the 'hover' method?

We call a .live() method like this: $('.link').live('click', loadContent); But what about if I'm binding to hover instead, which calls for two functions separated by a comma? When I put in this: $('.thumb.dim').live('hover', function(){$(this).removeClass('dim');}, function(){$(this).addClass('dim');}); The mouseenter event doe...

jQuery - How to remove event handler only while an animation or function is running?

I am attempting to create an image gallery. At the bottom I have a strip of thumbnails these thumbnails slide left and right when you click an arrow but if you click the arrow multiple times it ques the function. I would like to remove the click handler while the function is run, then replace it again. On a side note, my thumbnail scro...

[JQUERY] fancybox onStart onComplete status not working

hi,i'm trying to keep working onstart and onComplete method on fancybox (jquery plugin) they doesn't works for me ...do yo know why? this is the code: $(document).ready(function(){ //top-menu highlight link $(".photos").removeClass().addClass("active"); $("a.fancybox").fancybox({ 'overlayShow' : true, 'opacity' ...

jstree select element which contains exact string

I must check some nodes of my jstree (checkbox plugin) on page load $j("#tree_data").jstree("check_node",'a:contains('+tool_name+')'); but if tool_name = "aa" all nodes abaa, aaa, blaah will be checked. I need to check only the node that contains exactly "aa". ...

Prototype's Effect.Parallel equivalent in jQuery

I am trying to convert a Prototype slide-show plugin to jQuery. The animation function is fairly simple an intuitive: fade-out visible slide, fade-in next slide, both animations start and stop at the same time. Here is the Prototype code which I have yet to fully understand: fadeInOut: function (a, b) { new Effect.Parallel( ...

Fancybox plugin - overlay options problem

I am using the fancybox plugin http://fancybox.net I am trying to change the overlay options as detailed in the documentation, but no matter what I change the overlay options remain default. Here's what I have: <!-- header --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/s...

jquery and click function

Hi, <script type="text/javascript"> $(document).ready(function(){ $("#changeText").click(function() { $("#textBox").html("<div>text text</div>"); }); }); </script> How make that if i push on #changeText twice or more, i get two (or more) text text ...

jQuery - CSS - Rotate Div by drag mouse event

Hi, I'm searching since a few day without real result, maybe someone can help me here. I've a div on my page (can containt an image, a text area, other), it's draggable and resizable (thanks to jQuery UI), and i want to make it "rotatable", with a handle in a corner to drag and rotate it using css transform (-wekbit-transform, moz-tran...

how to replace a hard coded value with a variable?

I want to replace the hard coded string "Categories" with a variable. How can I do that? Instead of having Categories all the time, the word Categories may be replaced by the value held by a variable id, var id. $(this).closest('ul').append('<li><input type="hidden" name="Categories.Index" value=' + newValue + ' /><input type="text" val...

jquery issues with variables/pageYOffset

My javascript is having issues with the variable posy. This is all within a jquery onload function. Can anyone help me understand what is not right about this line? var dhei = $('.share_event_btn').offset(); var posy = (dhei.top+22)-(self.pageYOffset); EDIT: var ehei = $('.share_event_btn').offset(); var dhei = parseInt(ehei); ...

import XML file via AJAX.

The code below does most of what I need. The function is run every time a new image is loaded onto the page. However this has created 100 server requests to the same xml file.. which is not good lets be honest. So how do I rearange this function so only 1 xml request is used (even though im pulling 1 element out where i = id, the whole x...

Handling browser's back button with jsonp

Hello, I see quite a lot of History plugin for jquery but Im not quite sure which one of them supports JsonP (json with padding)? Do you guys know of a plugin where it can handle the Back button and JsonP requests? Thanks! ...

How can I attach some jQuery to a function that already exists?

I have the following mark-up: <dt> <input id="p_method_checkmo" value="checkmo" type="radio" name="payment[method]" title="Check / Money order" onclick="payment.switchMethod('checkmo')" class="radio" /> <label for="p_method_checkmo">Check / Money order </label> </dt> <dt> <input id="p_method_ccsave" valu...

How can I improve my coding style?

Hello, I have been using JavaScript and jQuery a lot lately and I think I can do just about anything I want with it by just Googling and reading tutorials... But often I notice that my coding style differs a lot from what's provided by other people, for example I only just recently found out about shorttags for if/else statements. Or I ...

Accessing an object via jquery

var url_string = '/index.php/dvs/get_dvs/' + id + '/'; $.ll = {}; $.ll.dvs_data = {}; $.post(url_string,{}, function (data) { $.each(data.dvs, function(k,v) { $.each(v, function(dvs_name, dvs_value) { $.ll.dvs_data[dvs_name] = dvs_value; ...

Javascript + jQuery, applying a blur effect to background images

Is there a way to apply a "blur" effect on a background image in Javascript/jQuery? [edit] By "blur" I mean a Gaussian/Motion blur not a drop shadow :) Thank you. ...

Jquery adding many checkbox values in IE8 very slow

I've been looking for a better way to count values of selected checkboxes in IE8, because at the moment it's painfully slow. My issue is: I have 60 checkboxes arranged in a grid Each checkbox has 4 values (each value represents a market segment) The user can check any of the checkboxes I need a running count of the totals for each segm...