javascript

Is it possible to make "#pragma -" like member listing on javascript source in Xcode?

If you're using Xcode, you may know member listing menu of Objective-C. http://www.flickr.com/photos/47601728@N06/4832964826/ Xcode lists members of javascript too, but marking lines by #pragma - is now allowed in javascript. Is there any way to do this? ...

How to load webpage after video completes.

I have an image that takes up the window, is the first frame of a video clip and has an "enter" button for the website. When you click "enter" it plays the video and then needs to load the home page. I have tried HTML5's video tag and the 'onend' method, but no luck. I have tried about 5 different open-source video players-none have scr...

Array is lost after passed to a function

I'm getting a length of 0 for the incoming array to this method below and undefined for the array properties that's being passed in below and not sure why: function BindAlbumDropdownList(aAlbums, defaultAlbumID) { if(aAlbums.length == 0) return; var albumDropdownID = $("#abumDropdown").attr("id"); AddDropdownItem("...

Driving directions with traffic

Hi all, How do I receive driving time between two locations with traffic. This information is displayed on iPhone maps application, when 'Show Traffic' option is selected. Appreciate your help. ...

jqModal jQuery Plugin - How to Set Timeout on Modal Popup?

Hi All, I'm using the jQuery Plugin jqModal. New to it, so i'm still learning its usage. What i'm trying to do is show the popup for say 3 seconds, then automatically close. Basically, here is the flow of events i want: My page loads. Show modal popup saying "Connecting to MySite.." (after 3 seconds) modal popup automatically cl...

how to determin if the current browser is in fullscreen mode in opera mobile

How in Javascript can we tell if the current browser is in fullscreen mode? is there an exact ratio of width/height i can depend on to measure this? Im hoping to have that info for Opera Mobile since it acts odd when it goes in full screen, it doesnt auto hide the small buttons at the bottom which means part of my bottom navigation is hi...

When a page loads an image, does it load it only once, or every time it is found in the markup?

When a page loads an image, does it load it only once, or every time it is found in the markup? and what about jquery, does appending an img cause it to reload again? I ask this because I have a high res image, but need to you use it in many instances on the markup. <img src="hello.jpg" /> <img src="hello.jpg" /> <img src="hello.jpg" /...

How to I retrieve the length in seconds of a <video> element using Javascript?

I have a <video> tag with the id of "liveVideo". How do I retrieve the length of the video in seconds? Thanks, David! ...

Accessing Django template {{Variable}} from JavaScript

I tried to access django template variable in html page inline javascript, it works fine. But if I include js using <script src="..> then it dont work. Is this limitation or I'm doing something wrong? I really appreciate your help. ...

jquery:Detect Finish of Loading Image....

Hi all, i use the following code to load image to a cell $(cell).css("background-image", "url("+iconImage+")"); As this image is loaded from server....it take times...i want to add an activity indicator on this cell until the image is loaded and stop when the image is loaded..i saw some example but as i don't know jquery....can not fi...

Code only works if I alert out before the code that's bombing out?

This is just freakin weird to me. So if I don't function BindAlbumAndPhotoData() { // Get an array of all the user's Albums var aAlbums = GetAllAlbums(userID, token); alert("aAlbums: " + aAlbums); if (aAlbums == null || aAlbums == "undefined") return; // Set the default alb...

How to add a for attribe to a div like label's for?

So what I want is a div what points to an input or a div with contentEditable=true. So if a click on the div then jumps inside the input. ...

jQuery function used as event handler and for initialization

I'm doing this over and over, and I'm not sure if it is the best way to do so in JavaScript/jQuery. I have a function that acts as an event handler, but also I need to call it on page initialization. Thus I have been using the following code: <script type="text/javascript"> $(function() { function doToggle() { $(...

javascript:show alert if not match

dear all..i have a textfield. i want after i have typed identity number inside it, the script can identifying to "user table" at DB. i want if id number not match can show an alert.. how do i do that?i'm newbie at javascript ...

jQuery - Dynamic table rows don't work in IE/Opera

Example (works in firefox): http://progamonth.com/files/tablestestfile.html I can't get select elements to dynamically get added to a table. This works in firefox, but it fails in IE and Opera. What's going on here? DOM code: <table id = "myTable"> <thead> <tr><th>1</th><th>2</th><th>3</th> </thead> <tbody> </tbody> </table> <select i...

What event is fired when window.print() is called?

Hi all, I am trying to work through this question and I have had little success tonight. I think I can make the code below work if I only knew what event was fired when the window.print() function is called. var browser_name = navigator.appName; if(browser_name == 'Microsoft Internet Explorer'){ window.attachEvent("print()",on_p...

Convert Carrage returns to br tags

Hi All, I'm stuck with a small problem of parsing carrage return in a text area. JQuery Code $.fn.escapeHtml = function() { this.each(function() { $(this).html( $(this).html() .replace(/"/g,"&quot;") .replace(/&/g,'&amp;') .replace(/</g,'&lt;') .rep...

HTML / JAVASCRIPT : Disable HTML CONTENT in contentEditable=true

What I want? I want a div what works like a textarea, I don't want to have the ability to edit things in the div, and paste images and so on just plain text. Example www.facebook.com - The best example is facebook's news feed. Why I need this way? If you check out facebook's news feed, you well see that the area where you can...

Retrieving Table cells value in Javascript - Firefox vs IE

Hi, I am using the following code to retrieve the content of a cell in the table. This works fine in Mozilla Firefox. But, its not working in IE. Any suggestions?? var langName = tblCells[1].textContent.trim(); The error message is: 1.textContent is null or not an object ...

Is there a way to emulate the mootools "domready" event without needing the full framework?

Is there a way to emulate the mootools "domready" event without needing the full framework? I want some javascript that decorates some of my textboxes to run before the onload event because i'm seeing a flicker of the un-decorated boxes before it runs. Ideally i'd like to hook in as the page is loaded but before it is displayed. And i ...