javascript

Undefined id property on td object when accessed through rows/cells collection

What is it I am doing wrong here: When I try to use the getttribute['id'] method on a TableCell object that I get from iterating through a tables rows/cells it returns undefined: var rows = document.getElementById["table"].rows; var cells; for(var i=0; i < rows.length; i++) { cells = rows[i].cells for(var j=0; j < cells.length; j++) ...

Javascript: Multiple Array looping

TL DR; What is the most efficient way to sort and compare values in a multiple arrays? Okay, so we'll assume a few constants to make this whole thing simple var a = [1, 2, 3, 4, 5, 6], b = [0, 9, 8, 7, 6, 88, 99, 77], i, j; Now if I wanted to see if any value in a is equal to any other value in b I'd have to sort through one of these a...

Difference between DOMContentLoaded and Load events

Hi all, What is the difference between the DOMContentLoaded and the Load event? thx, Viktor ...

How do I use a custom xml entity in a javascript file

I have an 'overlay.dtd' file with a line like <!ENTITY myentity "myvalue">. At the top of my xul file I have <!DOCTYPE overlay SYSTEM 'chrome://myaddon/locale/overlay.dtd'>. In my xul file, I have <script src='myscript.js'>. I want to know if there is any way to access 'myentity' from the script. alert("&myentity;") just alerts "" ...

How to reset a portlet parameter on a button click?

I have a Liferay portlet param "cmd" in my JSP page, which is initialized to a value "update". I need this value to be get changed to "delete", when a user clicks on the delete button of the form. How I can go about it? <liferay-portlet:actionURL varImpl="edit_survey_form_action"> <portlet:param name="cmd" value="update" /> <input...

Can Javascript Find And Replace Digit Dates to Formatted Dates?

Hello, can someone help me with a javascript regex question? I am trying to replace all the digit dates in a string to a formatted version. This is what I have so far txt = txt.replace(/\d{10}/g, 'Formatted Date Here'); Is this possible? Any help is greatly appreciated! Thanks! ...

How distinguish refresh and close event using jQuery ?

Possible Duplicate: Is there a way in javascript to detect if the unload event is caused via a refresh, the back button, or closing the browser? Hi all I have the below set of code $(window).unload( function() { test(); }); the test() will call when i close the window and also if i refresh the window ..... How can ide...

select by id in jquery

as all you know $("#ID") returns the element having ID. but this code always return even there's no element. alert($("#htrBuyerCouponNotice")); alert(document.getElementById("htrBuyerConponNotice")); in this case. those two line results are diffrent. I want to check whether there is an element has htrBuyerCouponNotice. do...

SharePoint And JavaScript not working

I have Create AsharePoint web site and i used SharePoint Desginer 2007 to update the Master page file in order to make the web site not accessible using any web prowser except IE and the code work just fine for my user account but the rest of the user can open the site with any Browser function detectBrowser() { var browser=navigator...

Show google maps on mobile website

Is it possible to add google maps on a site designed specifically for the iPhone? I have never integrated maps in my websites before, so this question really goes more because of my inexperience. Using basic html and javascript at the moment. ...

how to hold(and show) the current 'a' element when you put 'history.back()' that you clicked just a moment ago

in this page http://api.jquery.com/category/effects/ when you put 'up'(keyboard) and 'down',then put 'enter',it will go to the current url, and when you put 'backspace' it will always show the same 'li' element you put 'enter'. how to set this. this is my code: shortcut.add("up",function(e) { var a=$('#start ...

How can I know in Javascript if a web page is in English or Non-English?

To be specific, how do you check the web page source to determine whether this web page is shown in English or other language, such as Japanese or French? ...

How does disqus work?

Does anyone know how disqus works? It manages comments on a blog, but the comments are all held on third-party site. Seems like a neat use of cross-site communication. ...

Why is the return false stopping the alert?

Why does the return false stop the alert() from working and how do I get around this? If I remove it, the alert will show up, and then it will load the page that the <a> tag pointed to. <script type="text/javascript"> $("document").ready(function(){ $("a").click(function(){ if(!$(this).is('static')){ ...

How to pass from flash under the external reference?

I have Mac OS widget with flash. If to click on flash the URL in a window of a browser should open. But it does not occur. I use code like this: DETAILS_HTML='object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="700" height="460"...

Javascript menu that hovers over initial element

I'm trying to build a javascript menu using prototype that when you mouseover an element, that element is hidden and a bigger element is shown in its place that closes onmouseout. This is what I have so far to give you an idea, but it doesn't work and is buggy. I'm not sure what the best general approach is: EDIT: using the prototype ...

the 'Color Animations plugin' doesn't wokr on webkit(safari chrome)

the Color Animations doesn't wokr on webkit(safari chrome) http://plugins.jquery.com/project/color <script type="text/javascript" src="jquery.color.js">s</script> $('#start').animate({ 'backgroundColor':'yellow' }, 1000,'linear', function() { }) it is works well on firefox why ? thanks the answer is background,look next ...

Problem with the flash scrolling

I have mac OS widget with flash. There is a scroller on flash. Flash is loaded from the Internet. If I have time to press on scroller before the player will be loaded completely scroller works as expected. Otherwise scroller does not move. for FlashPlayer object I use: -apple-dashboard-region: dashboard-region(control rectangle); Plea...

Strips Menu With JQuery

Hello, First of all, I am not an advanced JQuery developer, however, I have been creating what I call Strips Menu with JQuery, you can see it here by clicking the Preview link on top: http://jsbin.com/uwopu3/edit When I click on a strip, it promptly shows the contents relevant to hovered strip but I need sliding effect something that ...

My inputs wont let me move the cursor with the keyboard?

This is a wierd one, both inputs and text areas, cant move through the text with the left and right arrows? there's lots of javascript/jquery on the page so it's likely a plugin is overriding, but thought i'd see if anyone's ever had a similar experience or got any pointers before i wade through mountains of code! ...