javascript

Adding a Doctype to the document dynamically using JavaScript

Hello all I want to detect whether a doctype exists for the current document and add one if nothing exists. I'm able to check whether a doctype exists using document.doctype. But how can i add one? ...

Text Search - Highlighting the Search phrase.

What will be the best way to highligh the Searched pharase within a HTML Document. I have Complete HTML Document as a Large String in a Variable. And I want to Highlight the searched term excluding text with Tags. For example if the user searches for "img" the img tag should be ignored but phrase "img" within the text should be highlig...

Quicktime Playback using Javascript

I have been reading the JavaScript Scripting Guide for Quicktime and in there it gives you an example on how to play a video using a javascript command. Unfortunately whenever I try, I am given the error document.Camera_0.Play() is not a function in firebug. My code is as follows: QT_WriteOBJECT_XHTML( 'video_place...

how to get co-ordinates of vector layer line points from openlayers ?

I am not able to find out how to get lat-lon values of all the points in the drawn line in the openlayer vector layer, like this openlayer-example. please help me where to search...? ...

how to fetch return values between jquery functions and post ajax jquery request to webservice

I have the following code where the function codeaddress geocodes the text feild value and returns geocoded value , geocoded value is stored in variable example ,how will i return the variable v2 to the function call and post to asmx webservice. <script type="text/javascript"> $(document).ready(function() { $('#SubmitForm')...

Javascript Regex - Insert word (hit)

Hi, is it possible to insert the word that was found into the replace ? $(function() { content = 'hallo mein name ist peter und ich komme aus berlin. Und du?'; words = 'mein na,berlin' words = words.replace(/,/,'\|'); words = words.replace(/\s/,'\\s'); regex = new RegExp(words,'gi'); content = content.replac...

HTML - overRide statusbar link location display

when on Mouse Over state on a link the status bar shows the link's location in the status bar like in the following image... is there a way to change\override this to show some desired text... ...

Lightbox close button behind Video on iPad (Safari and WebView)

Does anybody know why the close button of the Lightbox is behind the Video and not on foreground on the iPad (Safari browser and WebView in App)? Screenshot: http://i.imgur.com/SYI9w.png With other Elements (Image gallery, Text / HTML) the close button is rendered correctly. On Safari with Mac OS X (not iOS) the close button works co...

jQuery Error: Invalid object initializer

Hi, I have the following code in my page: <div id="data_body_container" style="overflow: auto; width: 880px; height: 500px;"> ... </div> and then below in the site: <script type="text/javascript"> $(window).resize(function() { var windowWidth = $(window).width() - 50; var windowHeight...

Passing parameter to GWT module

Hi, My GWT module UI is only single button (like AddThis/ShareThis Sharing Button), and all other stuff is done in JS Popup panels. Id is specified as Global JS variable (i.e. myConfig.id=22) and getting that Id in GWT module using JSNI method ($wnd.myConfig.id). NOTE: There is also another way pass parameter, which is by setting <di...

Jquery separate decimal number

If I have decimal numbers like: 18.1234567 5.2345678 -77.7654321 -0.4567891 How can I separate number before and after decimal dot using Jquery and is there any function that can recognize negative value of the selected number? ...

Disabeling Copy/paste from my form using java script

hello, i am searching for a way to disable copy and paste from my form using javascrip. i dont want the user to be able to past anything to the form or copying anything. help please. ...

Javascript passing string parameter - then using setStyle

Current function: function SetPopup() { x$('body').setStyle('overflow', 'hidden'); x$('#divOne').setStyle('height', document.body.offsetHeight + 'px'); x$('#divOne').setStyle('width', 100 + '%'); x$('#divOne').setStyle('display', 'block'); } What I would like to do is change this function such that 'divOne' would be re...

How can i dynamically update DIV block height?

I have 2 divs. 1st div should automatically change own height if 2nd div height was changed. var height = jQuery('#leftcol').height(); height += 20; jQuery('.rightcol-botbg').height(height); There is no ability to change HTML markup :( I have many DHTML layout changes, so I can't run prev. code anytime. I want to run it dynamicall...

Change text to dots in text field with CSS/Javascript

Hey all Is there a way to "mask" the input of a text field to act like a password field (to show dots instead of text) without making the text box of type password? We prefer CSS than javscript... any ideas? ...

Execute javascript

Hi, I have used a script I have found. Where it should do some thing when the mouse hovers over the element $this.hover( function () { tip.html("<p>" + tTitle + "</p>"); setTip(tTop, tLeft); setTimer(); }, function () { stopTimer($this); tip.hide(); ...

Asking confirmation before page unload, using window.onbeforeunload

Hi, On my parent page I added a script which ask confirmation befor page unload (On every button press) using window.onbeforeunload, The problem i use to open a subPage on this parent page, and on closing of the subpage i use to reload the parent page, but it ask confirmation and I dnt want that.... Any help will be really appreciated...

ExtJS Grid Paging Row Selection

Is there anyway in the ExtJS Grid to select a row that is located in another page, when the PagingToolbar is used. Any help would be greatly appreciated. ...

Adding jQuery UI breaks jQuery show()

I have some jQuery code that runs fine until I add the jQuery UI library (1.7.2) and this causes the show() method to fail when I specify a callback. $('#main.home ul#promotions').show(function() { if (typeof f == "function") f(); }); It would seem that jQuery UI overrides show and now I need to specify an additional parameter for...

javascript splice() causes "arrayName.splice() is not a function" error

Hi, I am trying to remove certain values from an array containing input fields in a form: allFields = theForm.getElementsByTagName("INPUT"); for(j=0; j < allFields.length; j++){ if(allFields[j].className == "btn" || allFields[j].className == "lnk"){ allFields.splice(j,1); } } It causes an error. Fir...