javascript

retrieve Scrollbar position with javascript

I'm trying to detect the position of the browser scrollbar with Javascript to decide where abouts in the page the current view is. My guess is that I'd have to detect where the thumb on the track is, and then the height of the thumb as a percentage of the total height of the track. Am I over-complicating it, or does Javascript offer an e...

I'm using YUI datatable. How do I tell once everything is loaded?

http://developer.yahoo.com/yui/docs/YAHOO.widget.DataTable.html Is it an event or something? ...

How to get around the event bubble using jQuery's: .live()

Hi there. Here is the code in question: $(".navItems>ul>li").live('click', function() { var selectorID = $(this).attr('id'); $(".infoList").slideUp('fast', function(){ switchTabInfo(selectorID); }); function switchTabInfo(selectorID){ var actionID = selectorID.substring(4); actionID = "#" + actionID; $(actionID)...

Why does the JavaScript need to start with ";" ?

I have recently noticed that a lot of JavaScript files on the web starts with ; immediately following the comment section. For example, this jQuery plugin's code starts with /** * jQuery.ScrollTo * Copyright (c) 2007-2008 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Da...

Unknown address suggestion

Usually when you try to add a marker to an unknown/ambiguous address you just get an error from the api. It would be much nicer if i could display a list of suggestions related to the address that was not found. The Google maps site has this feature but i do not know how to do with the api. Any help would be appreciated. ...

How do you know if an object is JSON in javascript?

How do I know if a variable is JSON or if it is something else? Is there a JQuery function or something I can use to figure this out? ...

Pass array to client side for display

Hey, I have an array which contains around 50-200 hyperlinks. How can I pass this array to the client-side so that I can iterate through the array and display each hyperlinks as a list item? The array will be stored in 'Application' as it's system wide and rarely changes. Could there be a more efficient way of achieving the hyperlinks a...

Looking for exhaustive list of commands and a way to set style

Hi All, I'm currently working with CKEditor (http://ckeditor.com/). I'm looking for: 1) an exhaustive list of commands available by default via 'execCommand'. 2) a mechanism by which to set styles (as in the same way the FONT and SIZE combo boxes do it). I saw the function called 'setStyle' in the documentation, however it seems ...

How do I make the unresponsive script warning come up?

I am making a firefox extension and I have a manual script entry box. I don't want the script to hang the browser when it is run. How can I make an unresponsive script error popup come up if the script runs for longer than a second. ...

Using jQuery.get with a file up a directory?

I'm using jQuery to write a simple utility app that's just run locally. It'll read from a list of files using jQuery.get and then display them along with some meta-data (which resides in a separate file). The images and meta files live in ../scored_images/*.[jpg|meta] I can load the file list with jQuery.get just fine (it's in the cur...

jQuery scrollTo plugin to scroll screen to div wouldn't work, why?

Hi all: I am working on a web application, whose mock-up page can now be found at: our server If you click on the blue title "step1" and then choose the option of "delivery to address", a form will show up using jQuery ajax load. No problem for this. Click on the "venue" radio button will take you to another form, no problem for this a...

disable f5 and browser refreshh using javascript

Hi All, I want to disable browser refresh using javascript. Actually i am using window.onbeforeonload abd i don't want it will be called when user refresh the browser. what is the best way to do it? Regards, Salil Gaikwad ...

Jquery Resizable Issue

Ok my windows are supposed to be resizable... the web site is http://opentech.durhamcollege.ca/~intn2201/brittains/labs/ my code is document.writeln('<object id="cursorObj" width="0" height="0" >'); document.writeln('<param name="movie" value="flash/cursor.swf" name="wmode" value="transparent">'); document.writeln('<embed id="cursorE...

Float Issue in IE

Ok I am making a simulated OS type interface. It should open up windows and have a drag handle. This all works perfectly. Then I added a image for an exit button I floated to the right... this made IE mad and IE screwed with the sizing and positioning =[ I've tried a crap load of things. None of which work. Anyone wana help? website is...

How to Fix my jQuery code in IE?? Works in Firefox..

I am using jQuery to show/hide a div container (#pluginOptionsContainer), and load a page (./plugin_options.php) inside it with the required POST vars sent. What POST data is sent is based on the value of a select list (#pluginDD) and the click of a button (#pluginOptionsBtn)... It works fine in Firefox, but doesn't work in IE.. The '...

XML Parsing using java script for Google maps latitude and longitude data

I m using XML for storing data and I m retriving it into google map application using java script.now I want to add latitude and logitude data into XML file as it arrives from the tracking device.I m facing difficulty in adding closing tag of root node when my data is appended in the XML file.Can any body help me? ...

how to use web api with javascript/php?

geonames.org got a web api you can use to get all the hierarchy for a city. you just enter the id and you will get the data back in xml. http://ws.geonames.org/hierarchy?geonameId=2657896 i wonder how you fetch the url with php and javascript, and which one should i use. cause the id's are in the mysql database. i will get them wit...

How Can I mimic a meta refresh with JS?

I tried to do <script type="text/javascript"> //<![CDATA[ document.write('<meta http-equiv="refresh" content="0;url=index.php" />'); //]]> </script> but that doesn't validate on strict =[ how can I do that with JS alone? ...

Google Map - Current location

Hello, I would like to get the address string of the current user location. Is that possible? Many thanks. Regards ...

how to use kml file in my code..

i download a kml file : <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"&gt; <Document> <Style id="transGreenPoly"> <LineStyle> <width>1.5</width> </LineStyle> <PolyStyle> <color>7d00ff00</color> </PolyStyle> </Style> <Style id="transYellowPoly"> ...