javascript

Delete browser history using jQuery

I have an ajax application that is based on jQuery. I enabled browser history using jQuery history plugin. But we find out that the application generated too much history. Especially, we provide an in-page "ajax-back" button that enable the page to return to previous ajax state. When the in-page "ajax-back" button was pressed, we w...

How to display count of child record in parent using Javascript or JQuery.

In the example below: <html> <head> <script src="some.js" type="text/javascript"></script> <script type="text/javascript"> //??? //??? ); </script> </head> <body> <table> <tr id="parent_1"> <td>Parent 1</td> </tr> <tr class="child"> <td>Child 1</td> </tr> <tr class="child"> <td>Child 2</td> </tr> <tr id="parent_2"> <td>Parent2</td> <...

Output using innerHTML

I need to output the contents of a Javascript variable which has html code in it: var jsVar = '<div> <p> Sample text </p> <img src="some image.jpg" alt="" /> <div>'; I want to add it to an object on the page using innerHTML. How do I do it ? ...

Load another page in the dialog

I was able to display a dialog when clicking on a link. How do I the pull another page's contents while in the dialog? ...

How do you get VS 2008 Javascript Intellisense working for complex prototypes?

I have been able to get javascript intellisense working correctly for a 'class' prototype defined like this: function GetCustomerList() { } GetCustomerList.prototype = { HEADER: { RETURN_CODE: 0, RETURN_MESSAGE: "", } , NUM_RECORDS: 0, START_RECORD: 0, END_RECORD: 0 }; I can type something...

Select a RadGrid Row (Client-side) inside RadWindows

Hello! I have a RadGrid inside of RadWindow... I need to select a Radgrid row in clientside... How can I do that? I´m trying to get the radgrid like that: var masterTable = $find("<%=radgridID.ClientID%>").get_masterTableView(); but always getting null... Any help? ...

How to open a file using JavaScript?

I have a servlet that write a pdf file as a ByteArrayOutputStream to the servlet's output stream. If I open the servlet URL the browser opens the file. But if occur an error on the servlet, the browser opens an empty pdf with an error message. Sending an error through the ServletResponse the browser opens the default error page. I want ...

Unix Time Stamp and JavaScript Time; too big!

Hi there, I'm using the flot graphing library for jQuery, and it uses javascript time for any time series (to remind, that's milliseconds since Jan 1970. Unix time is seconds). My current code looks like this: foreach($decoded['results'] as $currentResult) { if($currentResult['from_user'] == $user) { $strippedTexts = $...

using javascript, what options are there to set the currently selected navigation item?

using javascript, what options are there to set the currently selected navigation item? Assuming the page refreshes on whenever someone clicks on a navigation link, the only way would be to either do it on the server side or set it dynamically by looking up the current URL? Are there any other tricks? ...

How do I get javascript onto a control which might be initially hidden in ASP.NET?

I have a control that on 1 page is initially shown, but on another page is initially hidden. For the page that initially shows the control, the javascript in the control works fine, but for the page that initially hides the control, the javascript doesn't work. I've ended up registering the javascript in the code behind using: this.Pa...

How will Ecma-262 (EcmaScript 5) help you?

EcmaScript Fifth Edition, or Ecma-262, has been announced and contains some changes to the language. What features in the new version are going to help you write better code? ...

Firefox extension to write a script in a web page

Hello! I am new to firefox extension building and would like some help on an application I am creating. I would like to create a firefox extension that on choosing to activate the firefox extension, opens a new tab and sends the script to the page to display a certain amount of text or perform some sort of activity. The only problem wit...

Javascript - "let" keyword vs "var" keyword

In javascript 1.7, the let keyword was added. I've heard it described as a "local" variable, but I'm still not quite sure how it behaves differently than the var keyword. What are the differences between the two? When should let be used over var? ...

What is a good image chooser in jQuery?

I am looking for a nice image chooser in jQuery. Ext has a nice one here (under Examples and Demos -> Views -> Image Chooser). Is there something like this for jQuery? ...

How to synchronize scrolling positions for several iframes

I have an HTML layout based on tabs (say 5). In each tab I load an iframe. The iframe contents are variations of one another that the user can compare by switching tabs. How can I, in javascript, synchronize the scrolling of all iframes vertically and horizontally? In other words, scrolling in one iframe should scroll by the same amount...

IE7 Crashing on some machines, errors in Debug bar, but don't see 'showstopper'

I've recently been made aware that my site is crashing in IE7. I tested it on a bunch of machines myself, but of course it always runs perfectly. My brother just showed me IE7 on his computer, and it definitely crashes. I've got 'debugbar' running, and it shows some errors in the HTMLCheck, and is warning that fb:login-button is not r...

Why isn't chrome running this javascript

When I run this in Chrome (ver 2), it doesn't return the string, but it works in Firefox (ver 3). Why is this? <html> <head> <script type="text/javascript"> function disp_prompt() { var name=prompt("Please enter your name","Harry Potter"); if (name!=null && name!="") { document.write("Hello " + name + "! How are you tod...

What triggers "Object cannot be created in this context, Code: 9" in Firefox?

We see this occasionally in web apps on Firefox. What triggers it, and how do we prevent it? It seems to happen sporadically and the error message yields no useful information about line locations. ...

How does Javascript CANVAS works?

Javascript CANVAS is amazing: it allows us to draw something like lines, polygons on the browser screen. I wonder how does Javascript CANVAS works. For example to draw a line, does it use a series aligned tiny images to simulate the line or some other approach? Thanks in advance. ...

xpath greasemonkey

I am trying to modify gmail in a greasemonkey script. Using xpather i can get the xpath expression for the part i am trying to hide. But using following snippet i can not get a match. alert function is never called. Can anyone point me to what am i doing wrong? var allLinks, thisLink; allLinks = document.evaluate( "//html/body/div[...