javascript

IE javascript redirection

I have a javascript function which redirects user to a diff page. It goes like this... redirect : function(url) { if(!url) return false; alert(url); if (this.browserClass.isW3C) //IE 6.X comes here { window.location.href = url; } else if(this.browserClass.isIE4) { window.location.href...

Additional javascript keyboard shortcuts for wysihat

I'm working on a web application that uses wysihat to let the user edit a large textarea. I wanted a WYSIWYG text editor that was easily customized, and one of the customizations I was hoping to make was having a keyboard shortcut (I was thinking command/control + L) turn the current line into a heading. I can add buttons to do this ea...

jQuery Array of all selected checkboxes (by class)

In HTML I have a set of checkboxes grouped together by a class. I want to get an array in jQuery containing all the checkboxes that are selected/checked for that class (so other checkboxes on the page are ignored). So HTML code like this: <input type="checkbox" class="group1" value="18" checked="checked" /> <input type="checkbox" clas...

Javascript hard refresh of current page

In Javascript how can I force the web browser to do a hard refresh of the page? i.e., get a fresh copy of the page AND refresh all the external resources (images, javascript, css, etc.) ...

Invoking a Javascript from Lotus Notes on click of a button

I am building a Proof Of Concept for a component that was earlier built in vb6. Since the component has complex UI elements, I am not really sure how far i can reproduce the same thing with Lotus Notes UI elements. What I am now currently looking to do is the following. Create a Button in an exist LN form. When the button is clicked it...

JavaScript Replace String with a Character |

Hello, when I try the following it doesn't work: str.replace("| stuff", "") But if I remove the PIPE it does? str.replace("stuff", "") Why doesn't the JS function allow for the PIPE | ? What can I do to do a replace that includes a pipe? ...

dojo dijit dialog underlay not showing

I'm trying to have three different dialogs on as hidden initially, then depending on the response from the ajax form submit, i wish to show different dialogs. When the form is submitted and waiting for the response, i can show the "in progress" dialog. Then if the server returns an error response, I want to hide the first dialog, then d...

JavaScript debugging in VS2008

I'm having a real problem trying to attach the JavaScript debugger in VS2008 to a web project. The web app is an ASP.NET MVC project but I don't think that should matter. I'm using jQuery and have a .js file loaded when the page loads and in this .js file I call $(document).ready(function() { ... } and do some stuff and this "works." Wh...

Activate the event handler of an HTML element created with MooTool's extended element

In browsing a JavaScript file, I see the following line: this.close = new Element('a', {id:'close-btn', href: 'javascript:void(0);', 'class': this.typeprefix + '-deletebutton', events: {click: this.remove.bind(this)}}).inject(this.bit); I'm guessing that new Element() is a MooTools extended element. I can't seem to programmatically ...

Javascript to compare page you are on with a link

Hi folks, i have a menu, and i need the link for the current page i am on to be highlighted differently. I do a really twisted way of comparing strings now, but i am sure there is a smarter way? jQuery(document).ready (function(){ jQuery(".filteroptions .option").each (function (index,ele) { link=jQuer...

Javascript Memory Usage

In the following code: $(document).ready(function() { var content = ""; for (var i = 0; i < 1000; i++) { content += "<div>Testing...</div>"; } $("#Load").click(function() { $("#MyDiv").empty(); $("#MyDiv").append(content); return false; }); }); Load is a simple link and MyDiv is a s...

Dynamically loading an external CSS file

hi everyone, im trying to create a dynamic page using external .css pages where the page color will get changed below is my code.. but when i click the "href" i am not getting any output.. can anyone pls tell whats the problem in my code.. any sugessions or ideas pls.. thanks in advance... <script language="JavaScript"> function loadjsc...

How to add tooltip to a drop down/combobox?

I have to implement the tooltip feature for drop down. Also, tooltip will not be any static text, it should be the selected value of drop down. How can i do this in jQuery? ...

What is canvas in html?

This code is from http://processingjs.org/ which only works in firefox <!DOCTYPE html> <html> <head> <script src="../../processing.js"></script> <script src="../init.js"></script> <link rel="stylesheet" href="../style.css"/></head> <body><h1><a href="http://ejohn.org/blog/processingjs/"&gt;Processing.js&lt;/a&gt;&lt;/h1&gt; <h2>Sna...

Enter key in textarea.

Hi, I have a textarea, On every enter key pressed in textarea I want new line to be started with a bullet say (*). How to go about it ? No Jquery plz. I can observe for the enter key , after that !? Should I have to get the whole value of textarea and append * to it and again fill the textarea ? ...

Dynamically loading an external CSS file using javascript

hi everyone, im trying to create a dynamic page using external .css pages where the page color will get changed below is my code.. but when i click the "href" i am not getting any output.. can anyone pls tell whats the problem in my code.. any sugessions or ideas pls.. thanks in advance... <script language="JavaScript"> function loadjsc...

How do I send an AJAX request on a different port with jQuery?

I need to send an AJAX request to, for example, port 8080 where a daemon is running there. ...

jquery POST selector issue

$("#submit_js").click(function() { $.post( "user_submit.php", {score: $('input[name=vote]:checked').val() }, function(data){ $("#ques"+qn).hide(); ++qn; $("#ques"+qn).show(); }); }); the above jquery function posts some value to the user_submit.php file. wha...

Automated tool/APIs to fill up web forms

I am looking for a tool or API/library to automatically fill up a webform with data. I have a text file with 100s of records that I need to enter into a webform. I tried searching for some tool or browser APIs so that I can copy text to a clipboard and from the clipboard to the webform; but the search results are polluted by automated We...

Extracting 1 or more hyperlinks from paragraph text in Javascript using Regular Expression.

Hi Guys, Sorry to bother you guys again, but here's my dilemma. There must be a "better" regular expression to identify HTML link from a paragraph text (there can be more than 1 html links in the text). How do I extract all the link and anchor it in javascript? My attempt (in javascript) is like this: var urlPattern = "(https?|ftp):/...