javascript

Problems with parsing XHTML page via javascript

There is some xhtml page, the source of this page was parsed before loading in the browser, to find some XPath positions. Then this page was loaded into browser, and i want via JAvaScript(on some action) insert some text in XPath positions, that already have been found. Problem is, that in JavaScript(jQuery) i can get only innerHTML (HTM...

How JSDB generates .exe from Javascript?

Take a look here. It's a really neat project. I am just wondering how do they generate exes out of javascript code. I know they use TraceMonkey as their javascript engine. Edit: Here you can find an example at the bottom of the page ...

How can I create an HTML table with a fixed header that works in mobile phones like IE for windows mobile?

How do I create an HTML table with fixed header that works in mobile phones like IE for Windows Mobile? I have found this demo. It is great, however, it does not work in IE in Windows Mobile. ...

AJAX readystate breaking, AJAX not processing data fast enough?

http://www.w3.org/TR/2006/WD-XMLHttpRequest-20060405/#xmlhttprequest 4 Loaded The data transfer has been completed. readyState == 4 I used the ajax framework from w3schools. I want to process the data from a group of rows. (form fields). I loop through the form elements and send them to the ajax script. The ajax script then sends t...

Dojo dijit.form.NumberTextBox returning "NaN"

Howdy Folks, iam using an dijit.form.NumberTextBox, if no value is inside it returns "NaN" , is there any way to set it to Zero ? <dt><label for="xx"><?php echo $this->translate('xx');?></label></dt> <dd><input type="text" name="xx" id="xx" dojoType="dijit.form.NumberTextBox" required="false" value="0" ...

What are useful JavaScript methods that extends built-in objects?

What are your most useful, most practical methods that extends built-in JavaScript objects like String, Array, Date, Boolean, Math, etc.? String format trim padding replaceAll & replaceAll Array indexOf Date toMidnight Note : Please post one extended method per answer. ...

Trouble in passsing form object to javascript from an hyperlink

<a href="javascript:SelectAll(this.form)">All </a> <input type ="button" value ="test" onClick="SelectAll(this.form);" /> <script ......> function SelectAll(form) { alert(form); } </script> method 1 produce an alert message 'undefined' while 2 method works fine by displaying form object . I'm very much aw...

Javascript DoEvents equivalent?

Here is my shortened code snippet: $(document).ready(function() { $.get("/Handlers/SearchData.ashx", function(data) { json = $.evalJSON(data); }); //do some other stuff //use json data alert(json == null); }); Alert says true because evalJson is not done processing JSON data yet (21kb gzipped). I need to wait somehow for it to fin...

Why is Chrome submitting extra form fields? Is it a bug with Chrome?

I have a form being inserted into a page with jQuery. In all other browsers, it submits correctly... but in Chrome, some extra form fields from other forms on the page are being added to the POST. I'm not using javascript to submit the form, the form is just added with javascript and then submitted with a standard submit input. Has anyo...

Firefox Extension: Get selected text

I am working on a simple Firefox Extension and I want to get the selected text. I tried this: var WordCount = { /* ... */ changeSelected: function() { var selectedText = this.getSelection(); var words = this.countWords(selectedText); this.changeStatus(words, " selected"); //alert(selectedText); ...

Javascript and C# COM interaction

I am using C# COM Interop techniques to interact with some device from website using ActiveX. Right now I can call C# codes from javascript and pass only string values. But I intend to pass javascript structure into C# method and the reverse. How can I do that. Right now as an alternative I pass JSON formatted string from C# code and ge...

add templated div to page multiple times with different ids

I am using ASP.Net MVC along with Jquery to create a page which contains a contact details section which will allow the user to enter different contact details: <div id='ContactDetails'> <div class='ContactDetailsEntry'> <select id="venue_ContactLink_ContactDatas[0]_Type" name="venue.ContactL...

jQuery: how to produce a ProgressBar from given markup

So I'm using the ProgressBar JQuery plugin (http://t.wits.sg/misc/jQueryProgressBar/demo.php) to create some static progress bars. What I want to achieve is to from this markup: <span class="progress-bar">10 / 100</span> produce a progress bar with maximum value of 100 and current value of 10. I am using html() method to get the cont...

Accessing Client's 'localhost' from JavaScript Online

this is what I am trying to do. I have made a few .html pages with JavaScript code in it and hosted them on a Yahoo server. Now when a client with a certain browser views these web pages, the JavaScript code uses XMLHTTPRequest to make a connection at h1ttp://localhost:8080/myservlet/servlet1 to read some data. I know, I want to conne...

Do javascript event listeners need to be removed prior to removing the element they're attached to?

Suppose I have attached a variety of event listener to various form elements. Later, I want to remove the entire form. Is it necessary (or suggested) to unregister any event handlers that exist on the form and its elements? If so, what is the easiest way to remove all listeners on a collection of elements? What are the repercussions of...

Convert .NET DateTimeFormatInfo to Javascript jQuery formatDate?

I hava a jQuery UI datepicker which I intend to use with a textbox in ASP.NET MVC. The date-display in the textbox is localized via CultureInfo and of course should be recognized by jquery to select the correct date in the datepicker: <%= Html.TextBox("Date", Model.Date.ToString("d", currentCultureInfo), new { @class = "datepicker" ...

YUI dataTable row expandable/collapsible

Does someone have already made a script as following examples with YUI dataTable ? Example : http://extjs.com/deploy/dev/examples/tree/column-tree.html http://extjs.com/deploy/dev/examples/grid/grid-plugins.html I am looking for an example which produce same thing under YUI dataTable. I see this example with yui dataTable (http://www...

Script control client object loss of scope

I've got a script control that has a control embedded within it that exposes a server side property for a client side click event. For example, embeddedControl.OnClientAppointmentClick. So my question is how would I wire this event to my script control client object. I've tried something like embeddedControl.OnClientAppointmentClick =...

Why would javascript code not be able to access variables in the window that opened it (window.opener) if both windows are from the same domain?

I'm trying to use the Facebook Connect Javascript API. I have a Facebook login button on subdomain.example.com/foo/bar/baz/article.html. Clicking on the button opens a login page on Facebook's domain. After you log in, that child window goes to subdomain.example.com/foo/xd_receiver.html, which is a file that Facebook provides that just h...

What is the difference between showFeedDialog and publishUserAction Facebook API?

I saw few tutorials mentioning showFeedDialog, but none that mention how to use publishUserAction. what is the difference anyway? Is there anyway to use showFeedDialog without prompting the user ? Are there any good tutorial on how to use publishUserAction? why does publishuseraction have a suqeuncebase parameter while showfeedialog do...