javascript

javascript watching for variable change via a timer

I have a slide show where every 10 seconds the next image loads. Once an image loads, it waits 10 seconds (setTimeout) and then calls a function which fades it out, then calls the function again to fade in the next image. It repeats indefinitely. This works. However, at times, I'm going to want to over-ride this "function1 call -> paus...

Encode URL while send ajax

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

Visual Studio crashes when I view a JavaScript file

I start up an existing solution, click on a JavaScript file, the file opens up in the IDE for a few seconds and then visual studio disappears. This is consistent and reproducible. I saw this patch for KB958502 and installed it but it didn't seem to do anything. Any suggestions on how i can proceed as this is completely stopping my dev...

javascript disabling a div or a link? (for a 5-star rating system)

Basically, I've created a 5-star rating system. Pretty typical. It shows how many stars other people have given the item, and then when a user hovers over the stars, it lights up x number of stars based on how many they're over. It's all run by AJAX. They click 5 stars it automatically adds their 5-star rating to the group. The problem...

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=$...

Javascript: Retrieve Object Property Names

I'm trying to write a function that needs to know the property names of an object being passed in, like so: var data = { "key1":"value1", "key2":"value2", etc} ^ i want the string value "key1" How do I retrieve the string "key1" from data? I know I can set a property dynamically like data[prop]=value but i want to know ...

prototype | prototypejs framework help :how to get selected item text field of a html select control

<select name="DropList" id="serverDropList"> <option selected="selected" value="2">server1:3000</option> <option value="5">server3:3000</option> </select> i know in prototype i can get value by $('serverDropList').value but how can i get "server1:3000" ? Thanks ...

What is the easiest way to send a Javascript array via JSON to PHP?

I have a few arrays that I want to send to process with PHP. Using json2.js I will stringify the arrays like so: var JSONlinks = JSON.stringify(link_array); var JSONnotes = JSON.stringify(note_array); but then I'm confused. Do I need to use a XMLHttpRequest object? Is there another way? If that is the simplest way, could someone p...

JavaScript: When should I use a semicolon after curly braces?

Many times I've seen a semicolon used after a function declaration, or after the anonymous "return" function of a Module Pattern script. When is it appropriate to use a semicolon after curly braces? ...

jQuery UI Tabs Not Working

I just downloaded jQuery UI Tabs. In the included index.html file, it works fine, CSS and all, with no customization. I copied the files over to my web server, keeping the directory structure intact, and copied the content code to my already-existing index.html, but it does not work. My Header Code <script type="text/javascript" src=...

How to send email through javascript without using a program?

How can I simple send an email without Outlook or something with JavaScript? ...

Change value of jquery variable based on a select box

I have a jquery datepicker script and what I want to do is to change "minDate: 10" value by a select box. if the first option is selected the minDate:10 , if the second option is selected then minDate:20 etc... Is it going to update the datepicker in real time every time I select a different selection? Thanks in advance! $(function() ...

Can onclick take a function in a function?

THis is what I want. onclick="pager(function2();) but it doesn't seem to work. ...

Using the Module Pattern for larger projects

I'm interested in using the Module Pattern to better organize my future projects. Unfortunately, there are only a few brief tutorials and proof-of-concept examples of the Module Pattern. Using the module pattern, I would like to organize projects into this sort of structure: project.arm.object.method(); Where "project" is my global p...

Why is Flexigird not working on IE

Hi I have a page with a flexigrid on it and it works on FF,Chrome,Opera except IE. it points out that the error is at line of "if(!btn.separator)" which is null or not an object. Well, every thing inside that block is an error on IE cause i think the error is on the "btn" objects.. has anyone ever encountered this error? this is fr...

HTML/JavaScript: mouseover effect for image maps?

I'm trying to help out a nonprofit by doing their website. They want (ugh) their logo to serve as an HTML image map. In other words, when you click on different parts of the logo, you're directed to different web pages. They also, however, want mouseover effects: when you mouseover a particular portion of the image map, that piece of the...

How to detect textarea or input type="text" editing?

I use this snippet to prevent the user from accidentally navigating away from the editing page: var warning = false; window.onbeforeunload = function() { if (warning) { return ''; } } Now I want to set the variable warning to be true if any of the textarea or input type="text" has been modified, I want to use the onkeyup event...

jQuery plugin options: required, optional, inaccessible

I'm curious how to specify options to a jQuery plugin in a way that some are required, some are optionally overridden, and some can't be touched. I started off with the usual: jQuery.fn.plugin = function (options){ var defaults = { username: "", posts:10, api: "http://myapi.com" } var settings = jQuery.extend({}, defaults, options...

jquery time delay

i used this <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt; <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt; <script> $(document).ready(function() { $( "#navigation" ).accordion( "option", "active", -1 ); }); </script> i am devel...

Making a JQuery tooltip retrieve a new value every time the mouse moves.

As i am developing an application that makes use of a tooltip that will display a different value when the user moves the mouse. The user mouses over a table cell and the application then generates a number, the further right the cursor moves in the cell, the higher the value increases. I have created a tooltip that runs and when the ...