javascript

display "page loading" message

I'm trying to display an image (.gif) for "page loading" in html page until the output from my_script.py gets displayed, and I've no idea how to do that. This is what I've got so far. Many thanks in advance. HTML: <div id="loading"> <p><img src="./images/loading.gif" /> Please Wait</p> </div> <form action="./cgi-bin/my_script.py" m...

How to fadein an image change with JQuery

Hiya All, I currently have a site that uses the JQuery cycle plugin. The site uses the plugin to change a main background image. The cycle plugin also creates a paging section in the HTML which in my case i've customized to be a set of images. What i am trying to do is change the pager image once that particular "page" is activated. ...

Why does the 'window.resize' event fire when changing tabs in Chrome (6.0.472.55)?

I came across an interesting bug feature tonight when writing a handler for window.onresize in Chrome (the latest version 6.0.472.55). First open two tabs, then in the first tab open this jsFiddle. Resize the window at will and the dialog box works as expected. Now, try switching to the 2nd tab -_-. Why is resize firing when the tab is ...

How to work around the computation limitation of Javascript

Go to the following link http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_max_value Paste the following code in the left text script area <html> <body> <script type="text/javascript"> document.write(parseFloat("999999999999999")); document.write(""); document.write(parseFloat("55555555555555...

View all data attached to an element using jQuery's .data()?

If I've attached a number of key-value pairs to a DOM element using .data(), is there any way to iterate them so I can log them in the console? Alternately, is there a way to view this data with a development tool like FireBug? This would be really helpful when debugging a script. ...

Determining the dimensions of an image drawn on a canvas and when the mouse is over the image.

I've got an animation on my canvas where I have some images (drawn using drawImage()). For the sake of simplicity, let's say there's only two images. These images are following a circular path in faux-3d space such that sometimes one image overlaps the other and other times the second image overlaps the first. These images are also sca...

BIFF5 - Excel - Workbook Stream Problems (corrupt file)

Hi all, I am successfully writing to an Excel file, using javascript from my FireFox extension. I can get the formatting, and contents that I want, however I have run into a roadblock. In order to add the formatting, I have to EOF the Workbook Globals Stream, and BOF the worksheet stream. When I do that Excel says the file is corrupt. ...

How to make Connect not callback when reload page in YUI?

I found this a common issue, but it seems that there is no obvious solution after googling. In my page, some user action would trigger AJAX request. With YUI 2.X, the code is like below: Connect.asyncRequest("POST", url, { 'failure' : function() { alert('failed'); }, 'success': function() { doSuccess(); }, 'scope"...

How do i fade out all the other tr tags with jQuery

I want the user to click on the checkbox and other tr tags fade out and disappear... Here is the code for the table <table class="display" id="events" border="0" cellpadding="0" cellspacing="0"> <thead> <tr> <th></th> <th>Date</th> <th>Location</th> </tr> </thead> <tbody> ...

Highcharts - show every other x-axis category

I have Highcharts set up to display a graph with a bunch of xAxis categories. This is all working fine, but I would like to be able to skip some of the xAxis categories, so not everything one is shown. You can see an example of this working within Campaign Monitor's reporting section (screenshot: http://screencast.com/t/Y2FjNzQ4Y). Any ...

Text doesn't fade into right position due to multiplication issue in javascript

Hey all, It's strange that the same functions are being called here but the #group3 text doesn't fade into the right position. I think it's a math issue: var triggerID = $active.attr("rel") - 1; var image_reelPosition = triggerID * imageWidth; //The first time the 'rel' attribute is 2 and the second time the rel attribut...

nodejs/express testing

im writing an app with express. main file is called server.js one of the objects is var app = express.createServer(express.logger(), express.bodyDecoder()); then i have app.get("/",function(req, res){ res.send("Running"); } how do i use expresso, [or any other testing framework for that matter], to test the routes output? I looked a...

PHP return JS UTC date format

Is there any way I can return a date using PHP that is the same format that Date.UTC(y,m,d) returns? Here is an example of the format I need: 1274745600000 (Apr 25, 2010) ...

PHP And PDO preventing Javascript injection

Hey guys I have a site written in PHP utilizing PDO. I am using the bindParam() function to bind to a sql insert query: ("insert into Table (id, date, data) VALUES (?, ?, ?)") but I am able to insert a string containing "<script>window.location="google.com"</script>" How to prevent this? Thanks!!! ...

Using PHP within Javascript functions.

What is the best way to handle mixing PHP into Javascript? Should it not be done? Should it be done in a certain way? I am working on a project and I found the following javascript function: function getStuff() { <?php $stuff = "0:Select"; foreach ($this->stuff as $k => $v){ ...

difference between this and $(this)

Possible Duplicate: jQuery $(this) vs this When using jQuery, whats the difference between this and $(this)? ...

Javascript/JQuery join() method error when using on an array

Hello All, I'm trying to loop through my JSON array and assign a specific key of each element into a variable: Here is the array: "joining_profiles": [ { "pic": "http://graph.facebook.com/832332325303/picture", "id": 3, "name": "Test2 Gmail" }, { "pic": "http://graph.facebook.com/6...

how can I make a simple interactive web map of data for countries (bigger than what google Chart API allows)

I have a spreadsheet with: URL, 2 digit country code, Main Value, Less important values ... I just want to make a simple map that can be bigger than what Google Charts API allows (that one is limited to 600x600), but a similar level of simplicity. If it looks nice and is interactive (hovering on country shows data) all the better. If...

JQuery getting location of element relative to window

Given an HTML DOM ID, how to get an element's position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent since the element may be inside an iframe or some other elements. I need to get the screen location of the element's rectangle (as in position and dimension) as it is cur...

How to verify a form is empty ? PHP or JS

Hi All, Please, I'm a newbie in PHP, and created my web site, with a text form, i can verify with JQuery if the txt form is empty or not with the following code : $(document).ready(function() { $('#formLike').ajaxForm({ target: '#content', beforeSubmit: v...