javascript

How can I call a function at the very end of document.ready

I have multiple document.ready functions on a page and I want a function to be called when all my document.ready functions have been executed. I simply want the function to be called at the very end, after all other document.ready functions have executed. An example of this could be that each document.ready function increments a global ...

How can I replace a plus sign in JavaScript?

I need to make a replace of a plus sign in a javascript string. there might be multiple occurrence of the plus sign so I did this up until now: myString= myString.replace(/+/g, "");# This is however breaking up my javascript and causing glitches. How do you escape a '+' sign in a regular expression? ...

Problem with JSONResult

Hi, I' still newby to this so I'll try to explain what I'm doing. Basically what I want is to load a dropdownlist depending on the value of a previous one, and I want it to load the data and appear when the other one is changed. This is the code I've written in my controller: public ActionResult GetClassesSearch(bool ajax, string phy...

JavaScript & JQuery Multi Dimensional Array Search using CSV file

I have a CSV file, 2 columns Name & Image, I’m using Javascript / PHP to read and display the list of names in an auto complete search field. //-->This is what’s suppose to happen <--// When the user performs a search, they type something into the text field, the auto complete drops down with all available Names matching there Query, ...

Access to Label value with Javascript

I need to access to a value in a checkbox, the atribute value has content, so i need to place the id somewhere else i created a label, but i have not access to that value alert(check[i].label); // doesnt work where else can i place a value in checkbox. Please dont write that i can do this <input type='checkbox' id='bla' name='myb...

@EventListener on contrib:MultiplePropertySelection (Tapestry 4.1)

Hi. Is it possible to add @EventListener to a contrib:MultiplePropertySelection in Tapestry 4.1 (dojo) and listen to onclick on its checkboxes? I would like to redraw the component everytime I click on a checkbox (as I'm toggling disabled and checked properties on the rest of them then). I would like to achieve this (Java): @EventListe...

jQuery - Could use a little help with a content loader

Hi, I'm not very elite when it comes to JavaScript, especially the syntax. So I'm trying to learn. And in this process I'm trying to implement a content loader that basically removes all content from a div and inserts content from another div from a different document. I've tried to do this on this site: www.matkalenderen.no - Check th...

Javascript click function

I've got some code which works fine in IE but unfortunately not in Google Chrome/Firefox. It relies upon calling a click() event on a button from javascript. Reading around it seems that this is an IE specific extension (doh). Is there any way I can do a similar thing in chrome + firefox? To clarify, it's executing the click event on a ...

How to automatically reflect the new Updates (on Database) to User Pages

I am trying to create a new Notice Alert using PHP and Javascript. Suppose that a 100 users are currently logged into to the Online Notice Board Application and any One user posts a new notice. I want an immediate alert signal on all the users screen. I know, that the simplest way of doing it is to constantly Ping the server but I don't...

document.getElementById not working for <a> tag

hi, I'm very new to js so kindly help me with this. I am trying to add a class to a tag using onClick. The code is as shown below: <a class="gkvSprite" href="#" id="abc" onClick="showhide('1')">Click 1</a> <a class="gkvSprite" href="#" id="def" onClick="showhide('2')">Click 2</a> <a class="gkvSprite" href="#" id="hij" onClick="showh...

select time (HH:MM:SS.mmm) in javascript

I would like the user to select the time in javascript and to avoid selecting the wrong time. How should i do it? Is there some kind of javascript or jquery widget? or should i show the format and allow users to write it in (and i guess check it with regex)? i think these should be valid 1 (1s) 1:5 (1m 5s) 1.5 (1s, 500 millisecond...

How to disable scrolling the document body?

I have a HTML which has lot of content and a vertical scrollbar appears as soon as the HTML is loaded. Now from this HTML a full screen IFRAME is loaded. The problem is when the IFRAME is loaded, the parent scrollbar still persists, I want to disable the scrollbar when the Iframe is loaded. I tried: document.body.scroll = "no", it did...

How do I get javascript results using selenium?

I have the following code: from selenium import selenium selenium = selenium("localhost", 4444, "*chrome", "http://some_site.com/") selenium.start() sel = selenium sel.open("/") sel.type("ctl00_ContentPlaceHolder1_SuburbTownTextBox", "Adelaide,SA,5000") sel.click("ctl00_ContentPlaceHolder1_SearchImageButton") #text = sel.get_body_tex...

How can I make an upload widget in JavaScript with upload progress that will post a file to an IIS server?

I need to make a upload widget in JavaScript with upload progress that will post file to a IIS server, any suggestions guidelines or documentation? ...

How do you update a TextField from a grails remoteLink?

Existing markup: <g:textField name="identifier"/> <g:remoteLink action="newId" update="identifier">generate new id</g:remoteLink> Corresponding HTML markup: <input type="text" id="identifier" name="identifier"> <a onclick="new Ajax.Updater('guid','/webapp/domain/newId',{asynchronous:true,evalScripts:true});return false;" href="/webap...

a4j:jsFunction with actionListener inside of h:dataTable

Hello all, I'm having problem with using a4j:jsFunction with actionListener inside of h:dataTable, when I want to invoke an action over particular row with a4j:commandLink it works flawless but when I want to invoke the action with a4j:jsFunction & actionListener it's always invoked over the last element in dataTable Let me give you an e...

javascript getElementById and convert it to String

Hi, is there a way to convert a javascript HTML object to a string? i.e. var someElement = document.getElementById("id"); var someElementToString = someElement.toString(); thanks a lot in advance ...

Got a question I don't understand, can anyone make sense of it?

Question from an online resource paper: Create javascript so that the following methods produce the output listed next to them. circle = new Circle(); console.log(circle.get_area()); // 3.141592653589793 circle.set_radius(10); console.log(circle.get_area()); // 314.1592653589793 console.log(circle); /...

Get value of last option of a drop down?

I have dropdown menu..which is dynamic.. How can get value of the last item in that drop down (using jquery is also acceptable) ...

Javascript/Greasemonkey: search for something then set result as a value

Ok, I'm a bit of a n00b when it comes to JS (I'm not the greatest programmer) so please be gentle - specially if my questions been asked already somewhere and I'm too stupid to find the right answer. Self deprecation out of the way, let's get to the question. Problem There is a site me and a large group of friends frequently use which ...