jquery

confirm box when link is clicked

<script type="text/javascript"> $("a.route").live('click', function() { // live is better $("#results").load( $(this).attr('href') ); return false; }); </script> thats the code, how can I incorporate the code you just gave me? ...

jQuery prevent action to be executed before it starts

Hello all, I am having a small problem. I have a nevigation build which opens when mouse is over, but also listens to keypress, than firing same animation as if mouse is over, just additionally opens the submenu. Now, when keypress is active and I am going with the mouse over that navigation, it fires the closing action before I can cli...

HTML is not being interpreted after JQuery's .ajax function

Hello there... Once I have retrived an HTML string with the $.ajax function I put it into a div... the HTML is a simple message with a <b> tag, but it's not being interpreted by the browser, I mean, the <b> is not making the text bold. Here is what I do: $.ajax({ url: 'index.php?ajax=ejecutar_configuracion&id_gadget=cubrimientos',...

Combine multiple JSON files into one; retrieve using jQuery/getJSON()

I have some jQuery code which retrieves content using getJSON(). There are n JSON files, which are retrieved from the server as needed: /json-content/data0.json /json-content/data1.json /json-content/data2.json etc... Instead, I want to store all the JSON in a single file to reduce the number of HTTP requests needed ...

JQuery\Javascript - Passing a function as a variable.

I was just curious if I could pass a function as a variable. For example: I have a function $('#validate').makeFloat({x:671,y:70,limitY:700}); I would like to do something like this: $('#validate').makeFloat({x:function(){ return $("#tabs").offset().left+$("#tabs").width();},y:70,limitY:700}); This does not work, but ideally every ...

Dynamically change MYSQL query within a PHP file using jQuery .post?

Hi, Been trying this for quite a while now and I need help. Basically I have a PHP file that queries database and I want to change the query based on a logged in users name. What happens on my site is that a user logs on with Twitter Oauth and I can display their details (twitter username etc.). I have a database which the user has add...

jquery question about small calcation when radio button is checked.

jQuery $(function() { var service1price = 1; var service2price = 2; $("#service1checked").one('click', function() { $('<div id="service1ok"> Service Number 1, ' + service2price + ' $ </div>').fadeIn().appendTo('.selecteditems'); }); $("#service2checked").one('...

JQuery cookie access has stopped working for GAE app

I have a google app engine app that has been running for some time, and some javascript code that checks for a login cookie has suddenly stopped working. As far as I can tell, NO code has changed. The relevant code uses the jquery cookies plugin (jquery.cookies.2.2.0.min.js)... // control the default screen depending // if someone is ...

jquery build table

menuOrder is an empty div $("#menuOrder").append('<table>'); $(menus).each(function(i, menu) { $("#menuOrder").append('<tr><td>'); $("#menuOrder").append(menu.text); $("#menuOrder").append('</td><td>'); if (i > 0) { ...

Categorize items at page load based on radio buttons - jQuery

I'm using jQuery UI Sortable to make a list "categorizable". I'm stuck on the code to put items in the proper category when the page is loaded with existing data (either from the database or just from a prior form submit). The html is a list with radio buttons: <ul id="Main" class="sort"> <li> <input type="radio" name="i1" id="i1...

server side Adobe AIR apps

This might sound like a really stupid question, but is there anyway to run an Adobe AIR application in a headless server side mode on a non-UI server (i.e. Linux)? I'm trying to build server side bots to interact with an API (grapevinetalk.com) and I want to use existing code to do that without having to re-write all the data munging et...

JQuery: How to determine if Slide event is up or down?

I have the following code: $('a.btn-slide').toggle(function() { $("#DivToSlide").slideUp("fast"); // ... }, function() { $("#DivToSlide").slideDown("fast"); // ... }); Later in my code, I want to find out if #DivToSlide is in either the up or down position. How do I do that? ...

Print new line in the source-code with jQuery.

I have a simple function in jQuery that creates new elements in the DOM. the problem is in the html source code, it append every element in the same line, and it's very bad to read. function _loadNewElements(elements){ for(var i=0; i<elements.length; i++){ var fixedElement = $('<img />') var position = elements[i].p...

Opposite of .find()

Is there an opposite of .find()? Where $('.myclass').except('#myid'); Would grab all elements with .myclass except the element with #myid. I know I could do $('.myclass[id=myid]') in this example, but seems like it would be helpful in other cases. Thanks EDIT: Thanks for the responses! Looks like I just missed seeing .not() and :not...

Encode URL while send ajax

I use cakePHP and it generate ajax /animemanga/animes/search/page:1?type%5B0%5D=3&amp;genre%5B0%5D=20&amp;genre%5B1%5D=4&amp;info%5B0%5D=episodes&amp;info%5B1%5D=released&amp;info%5B2%5D=rating&amp;info%5B3%5D=synopsis&amp;info%5B4%5D=completed&amp;info%5B5%5D=rating_count&amp;info%5B6%5D=name&amp;info%5B7%5D=id&amp;info%5B8%5D=name&amp...

Galleria jQuery plugin briefly shows all images in IE 7 & 8

I'm using the galleria jQuery plugin on a site. When the gallery first loads, all of the images appear briefly & vertically in ie 7 & 8. This doesn't happen when i isolate the gallery, only when i put it on a somewhat heavy page. This leads me to believe that it happens when the page is a little slow to load. Does anybody know a way to...

Javascript access object variables from functions

function init_exam_chooser(id,mode) { this.id=id; this.table=$("#" + this.id); this.htmlRowOrder="<tr>" + $("#" + this.id + " tbody tr:eq(0)").html() + "</tr>"; this.htmlRowNew="<tr>" + $("#" + this.id + " tbody tr:eq(1)").html() + "</tr>"; $("#" + this.id + " tbody tr").remove(); //Arxikopoiisi var rowNew=$...

Filtering duplicate array entries with JQuery

How do i filter duplicates of two arrays before appending entries to a DOM node (#list)? (function($) { $(document).ready(function() { var item_category1 = $('li.category1').get(); var item_category2 = $('li.category2').get(); $('#list') .append( $(item_category1).clone() ) .appe...

How to know $(window).load(); status from jquery

I have created a website loading bar using Jquery UI Progress bar, this progress bar shows the status of scripts loading. A sample is $.getScript('_int/ajax.js',function() { $("#progressinfo").html("Loading Complete ..."); $("#progressbar").progressbar({ value: 100 }); }); This progress bar is in #indexloader which is blocking...

YouTube API, jQuery attr won't swap element attributes (I think) in IE, but works in FF

JavaScript (jQuery) function display_youtube(new_url) { $('#movie_url').removeAttr('value'); $('#embed_url').removeAttr('src'); $(document).ready(function() { $('#movie_url').attr('value', new_url); $('#embed_url').attr('src', new_url); $('#shade').css('display', 'block'); $('#youtube_player')...