javascript

javascript validation for empty input field

Greeting, I have this input field <input name="question"/> I want to call IsEmpty function when submit clicking submit button. I tried the code below but did not work. any advice?! <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=unicode"/> <meta content="CoffeeCup HTML Editor (ww...

Window.open as modal popup?

I want open window.open as modal popup. var features = 'resizable= yes; status= no; scroll= no; help= no; center= yes; width=460;height=140;menubar=no;directories=no;location=no;modal=yes'; window.open(href, 'name', features, false); I can use Window.ShowModelDialog(), but in my child window I am calling parent javascript metho...

JQuery Scrollable Missing position onload and on api seek in webkit browsers

Hiya All, Strange issue i am having while working on this in the bottom right hand corner is a history section with a scrollable section that moved right or left. On load it picks a random number and moves to it. Problem is that on load (without moving) it loads in the wrong position, and on moving with the api it moves to the wrong of...

use jquery to modify class attribute

<ul> <li><a class="selected">A</a></li> <li><a>B</a></li> <li><a>C</a></li> </ul> How can I remove the attribute selected from all <li>'s when one of the element is clicked and set the one being clicked to selected? I'm learning jquery. Updated the code ...

Javascript INDEX_SIZE_ERR: DOM Exception 1 Error for ranges

Using the following code, I get a INDEX_SIZE_ERR: DOM Exception 1 error on the thisRange.setStart line. The code is meant to go through a whole page, find instances of the searchString, and then add a link in front of that search string. For example, if it finds 5 instances of the string, right now it will add the link in front of the fi...

How do I cause a cross-platform (IE and Chrome at least) popup from inside an SVG?

I have code that generates SVG that was developed for IE and the Adobe SVG Viewer. The Adobe SVG Viewer has a custom function called browserEval (see http://www.xml.com/lpt/a/994) that is being used to cause the browser to eval a window.open() call. This doesn't work in Chrome's native SVG renderer (and I haven't tried Firefox). How c...

javascript - remove element/node with no ID and specific content

I'm struggling to decipher a way to remove several specific href elements which contain no IDs and are children of individual parents with no IDs. The best I can manage is identifying the four offending, out of 8 or 9 href tags (and the number may vary), by a specific word within the URL itself. For this, I do the following: <script l...

Social network visualization tools for PHP/JavaScript

I'm looking for a tool that will allow me to display visualizations of social networks dynamically online. There are a lot of great visualization examples out there already: http://www.readwriteweb.com/archives/the_best_tools_for_visualization.php http://socialmediatrader.com/10-amazing-visualizations-of-social-networks/ I know lots ...

Magento - how to include javascript file on a page by page basis

In magento I know how to include js files in the page layout file. How though, do i include specific javascript files only on certain pages with my custom module. For example i am writing a custom module that will work with the product view and list pages. I therfore want to have some sort of layout update that i can use with my module...

Determine BlackBerry height including vertical scroll area

I need to detect the height of a web page displayed on a BlackBerry and I've tried the following. height, window.innerHeight, and screen.availHeight My BB 9700 simulator returns values of 304, 327, and 360 respectively. The closest "correct" value is 360 since that's the actual height of the displayed page. However, the site has a ve...

Retrieve form's "name" attribute in Javascript whereas an input exists with name "name"

Hi there ! I have something like this HTML structure : <form name="myvalue" id="hello"> <input type="text" name="name" /> </form> I'd like to retrieve the form's name attribute in Javascript, with a cross browser solution. Obviously, document.getElementById("hello").name won't work because it will return the corres...

Inversing DOM with jQuery

Input: <content> <dom id=1>a</dom> <dom id=2>b</dom> <dom id=3>c</dom> <dom id=4>d</dom> </content> Output: <content> <dom id=4>d</dom> <dom id=3>c</dom> <dom id=2>b</dom> <dom id=1>a</dom> </content> I'm looking for a function (if exists) like this: $('content').inverse(); ...

hijack refresh key

Question How do you overwrite the refresh key with a custom javascript function? I use Prototype library, by the way. Why I have a video with user comments on the side. There is a button to only refresh the comments via a JS function updateComments(). During some user testing, some idiots refused to use that button to update the comme...

How do I remove these tags with JavaScript

I'm still learning regex (obviously) and i can't figure it out, and i want to do it the right way rather than doing it the long way. How can I: Find all <p> or </p> and replace with a \n except the first <p> and last </p> in which case replace with nothing, just remove, and for <br>, <br /> and <br/> replace with \n also. With Regex OR...

jQuery trigger not working in IE. Why?

$('#XynBp0').find('input').each(function(){ if ($(this).attr('value') == 'Cancel'){ $(this).trigger('click'); } }); doesn't work in IE7 ...

jQuery UI tabs javascript click function not working.

I am using jQuery UI tabs, but I am having an issue. My javascript code: $(function() { $("#tabs").tabs(); }); My HTML: <div class="demo"> <div id="tabs"> <ul> <li><a href="#tabs-1">Eat</a></li> </ul> <div id="tabs-1"> tab 1 </div> <div id="tabs-2"> tab 2 </div> <div id="tabs-3"> ...

Close Window for button click

I have been trying to close the window on button click but am unable to do so. I have added javascript window.close() added on the code behind page on button click event all in vain. Language c# or vb.net ...

Javascript delayed image loading

Hi all, I am trying to delay the loading of images using plain JS. my method to do this is by giving empty src field for the image and inserting the image url into a temp attribute called "lang" as used in the example below. ie > <img lang="logo.gif"> instead <img src="logo.gif">. When pressing a button the js below is initiated to inser...

Facebook Iframe Issue

Hi, I am working on an iframe based Facebook applicaton. I am able to use FB.Canvas.setAutoResize(); to let the iframe "stretch" the page so there's no scroll bar for the iframe. The page may be 2-3 page-length in height. I can scroll down the page using the windows scroll bar. The issue is when I am at the bottom of the page and I c...

Nodejs web server calling requestListener twice when page is loaded

Hey guys, I am trying out node.js, the following is the example web server from the documentation with an added counter and it prints the counter to the console when ever a client/browser requests the page. The problem is, its being called twice when requested by the browser. This is what I would expect would happen: browser : Hello...