javascript

Parsing HTML with XPath/XMLHttpRequest

I'm trying to download an HTML page, and parse it using XMLHttpRequest(on the most recent Safari browser). Unfortunately, I can't get it to work! var url = "http://google.com"; xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", url); xmlhttp.onreadystatechange = function(){ if(xmlhttp.readyState==4){ response = xmlhttp.responseTe...

JQuery: .text() get the html within a node, how do I set the text within a node?

Using JQuery, I can do the following to get the text within my LI $("#listingTabs li").eq(2).text(); How do I set the text? Because the following doesn't work $("#listingTabs li").eq(2).text() = 'insert new text'; ...

Need temporary Client-side solution for handling browser "Back" button

At this moment I cannot make changes to the code behind for a few weeks, but can change the .aspx file. We have some internal users that will click the IE7 "back" button to navigate back 5 or 6 pages (which is specifically against stated rules and training). There are a very few pages where this is causing us major problems with duplic...

Disabling a JQGrid dropdown in an edit dialog form

Does anyone know how through either javascript or jquery know how to disable a select (dropdown) control within a Jqgrid edit dialog form? Thanks. ...

javascript not working on IE, but ok to all other browswer.

Hello any one can help a beginner please. the code is for adding a password on the webpage, which working for all other browser but not for IE. <HEAD> <SCRIPT language="JavaScript"> <!--hide var password; var pass1="cool"; password=prompt('Please enter your password to view this page!',' '); if (password==pass1) alert('Password Corr...

Possible typos in ECMAScript 5 specification?

Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and UnicodeEscapeSequence are not followed by two colons? From section 5.1.6: Nonterminal symbols are shown in italic type. The definition of ...

Open save as dialog on newly opened window

How in JS/jQuery do I pop open the "Save As" dialog for a newly opened window. Basically I am scraping some data off of a web page. As such I am opening a new window via: dataWindow = window.open('blank','dataWindow'); I then write the output to the blank window but I want to automatically pop open the "Save As" dialog to save the c...

Detecting individual Unicode character support with JavaScript

Is it possible to detect if the client supports a particular Unicode character or if it will be rendered as a missing glyph box? Important: Support in as many browsers as possible Not important: Efficiency, speed, or elegance The only method I can think of trying is using a canvas, so I figured I'd ask before I start going down that r...

How to debug node.js applications

How do I debug a node.js server application? Right now I'm mostly using alert debugging with print statements like this: sys.puts(sys.inspect(someVariable)); There must be a better way to debug. I know that google Chrome has a command line debugger. Is this debugger available for node.js as well? ...

Updating an ActiveScaffold form based on the selection of a drop-down

In a thread on the ActiveScaffold Google Group, I worked out the basics of hiding fields based on the value selected in a SELECT drop-down. However I am now stuck on a similar but more complicated version. I have the following models in a Rails application: class Sale < ActiveRecord::Base belongs_to :product validates_numericali...

make div text disappear after 5 seconds using jquery ?

Hi i need to make a div text disappear after x seconds of displaying it using an ajax call can you help me on this please ? thanks ...

Javascript "watermarks" for textboxes

I would like to know how to put text in a textbox when the page loads. Example: If I have a login page, I would have 2 textboxes named "username" and "password". When the page loads I want the the textbox to load with "username" written inside, so I won't have to put a label for that outside. But when the user clicks inside textbox it sh...

PHP/ Ajax/ jQuery - Equivalent for my code

I have the following code and would like to use jquery to make it simpler: var auctionBidAjax; function auctionBid(auction_id) { auctionBidAjax=GetXmlHttpObject(); if (auctionBidAjax==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="/cms/ajax/auctionBid.php?auction_id="+auction_id; auctionB...

Group select boxes into array for post?

I know how to send data via a multi-select form object and group the data into an array: <select name="my_data[]" multiple="multiple"/> Is it possible to have multiple different select boxes with "single" values and push them all into an array? i.e. <select id="select-1" name="my_data[]"/> <select id="select-2" name="my_data[]"/> r...

Selector only knowing tbody and iterating

This is driving me nuts...I am trying to iterate through rows in a table. I know the classname for the tbody. Can I just specify the class for the tbody and iterate through the rows? For example... <div class="dclass1" ...> <table summary="" style="margin-top: 0pt;"> <thead ...> <tbody class="tbClass1" ..> ... ...

fill in space with the next element with slide animation

basically what I wanted to do is whenever an li is removed (via jquery .remove()) the set of li's slide to the space previously occupied the removed li. How can I accomplish this? Here is some code: <li class="be-imagecontainer"> <span style="display:none">101</span> <img src="http://localhost/thi/media/images/thumbnails/19_Koala.jpg"...

How do I pass argument to anonymous Javasript function?

Hello, I am writing a simple counter, and I would like to make installation of this counter very simple for users. One of the simplest counter code (for users who install it) I ever see was Google Analytics Code So I would like to store main code in a file and user who will install my counter will need just to set websiteID like this: ...

firefox and javascript

Hi, Im doing some javascript code and im using firefox. i have a problem which is getting always the same result when im trying to print out an array. the array is calculated in the code through some algorithms. I realized that sometimes im getting new result when i clear private data in firfox by Tools --> Clear Private Data but i need ...

Detaching/Opening an iFrame into a New Window - How?

Hi, I have an iframe setup within a page and basically want to know whether it's possible to have a button in this iframe and when pressed, opens the iframe into a new browser window, showing the contents of the iframe. If possible, would really appreciate any help using either javascript or jQuery on how to achieve this. I am using I...

How to scroll to bottom of page when postback finish in asp.net?

How to scroll to bottom of page when postback finish in asp.net? I have many detail in page whan i clicking show detail in master detail this page show many data in my page so how to to scroll to bottom of page auto ? ...