javascript

get current width of html form using javascript

I want to get the current width of an html form using javascript. I'm writing this in asp.net Form definition: <form id="form1" runat="server"> What I an trying: document.getElementById('form1').style.width Keep producing a runtime error... Any ideas? Thanks! ...

How to bind the 'toggle' event to a element

Hi, Is there a way I can use the 'bind' syntax for the 'toggle' event handler ? From the docs I can understand that the correct way is $('.selector').toggle( function() {}, function() {} ); My problem is that I am removing that element for some reason, and then again add it to the DOM. On adding it again, the toggle does not work....

How to e.startDefault when e.preventDefault is set?

Hello, function loaded() { document.addEventListener('touchmove', function(e){ e.preventDefault(); }); } loaded(); At certain times I want to allow default. How can I do that? ...

Loading Xml to jgrid

Hi, i am using jgrid. i am creating a specific XML as per the jgrid format using c#(Castle Monorail). i am sending data to view in string format and pass it to "url:" but its not working. but if i m passing the xml file path to the "url:" its working and data is showing in the grid. Is i m doing mistake any where. Should i have to paa...

how to change the content place in html pages without changing header and footer

I have five html pages ,all pages have same search tab,header,footer, my question is when enter particular searchtext and click search only the content place where the output will be displayed has to be changed in the html pages without change in header and footer. I am using html ,javascript,jquery on clientside and webservices with ...

Set always Focus on Textbox (ASP.NET, Updatepanel)

Hey, Before I start to write my problem, I will excuse for my bad English and I hope you can understand me. I have in a ASP.NET Webapplication an AJAX Updatepanel. In this Updatepanel is a Textbox for dynamic search results. When I start to write in the Textbox, the results comes like Google suggest. Now, the focus must be always on th...

Can I set 2 address at a time in google map. ?

Hi I have to set two address at a time in google map. User provides these two address. after submitting I have to show these two address on map. amy body knows the script. Please help me. ...

Hidden HTTP Post in Javascript

Hi, I'm trying to do an HTTP Post using Javascript. I'm using the code reported here: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit and it works fine. But I need to remain in the same page while the HTTP Post is sent. How can I do? Thx ...

Symbolic link for html file with an embeded flash swf located in different directory in redhat or centos Linux

Hi All, I have created a html index.html which has an embeded code linking to index.swf in an folder both these file are in the path say /home/user-name/ When i created a symbolic link to index.html in the path /home/user-name/Desktop . when i click on the symbolic link index.html file it opens in the browser but the flash file inde...

HTML spellcheck on existing text Chrome

I'm trying to use HTML spellcheck on a textarea in Chrome. This works on the text I type but, I need to use it with existing text. This doesn't work, only when I select the text then the spellcheck activates. I simply use this: <TEXTAREA spellcheck="true" class="operatorchat" name="inputtext" id="inputtext">This text is worng!</TEXTAREA...

How to get word under cursor?

Assuming there is a mousestop event attached to the entire document, what is the best way to figure out the exact word under the cursor (if there is any text), when the mouse stops moving? I can get the underlying (jQuery) element from the event handler - $(document.elementFromPoint(e.clientX, e.clientY)) - but then what is next? So fa...

Validate dropdownlist selectedvalue against a list from static property

Hi, I am using javascript to validate user input on my aspx page. I am easily able to validate textboxes and dropdown list for differenet scenarios. Now, on one of my dropdown lists (for country), I need to check if it is an allowed country or not for a particular service. I have stored the valid country list in a static property. Is ...

Drupal: add a js function callback to Drupal.settings.

Im using [drupal_add_js_()][1] function to add a fancybox effect to some image in my nodes (im not using the Fancybox module becose doesnt fit my needs). In short, i need to add the titleFormat function to format the image title; In my javascript file, it looks like: $("a[rel=myfancy_group]").fancybox({ 'transitionIn': 'elastic', ...

Stripping out < and > in javascript doesn't quite work

function SanitizeInput(input) { input = input.replace(/</g, "&lt;"); input = input.replace(/>/g, "&gt;"); return input; } document.write(SanitizeInput("Test!<marquee>bibble</marquee>")); If you pop this into jsfiddle.net the result is Test!<marquee>bibble</marquee without the trailing > Can anyone...

How to make JS-library agnostic selector wrapper?

What is the best way to create library agnostic wrapper for JS library selectors? I have a custom JS framework, that aims to be as library-agnostic as possible. The problem I have is that for example Mootools enhances the returned DOM element with it's own specific methods (inject, adopt etc.), and I don't want these to be visible to the...

how to fire the "ondblclick" event of a link

I want to do this: when you click a link on a page, it will open the link normally, but when you double click the link, it will alert the link's 'href' attribute. However, when I try to double click a link, it will always open the link. Any idea? ...

I want to push a selected value into a select/option dropdown

I want to select a value in a select/option dropdown using javascript only. Revised sorry for confusion. Here is revised code. document.getElementById("sel_activity").value = activity; This will also work, but is a bit longer.. <select id='sel_activity'> <option value='CYC'>Cycle Count</option> <option value='INV'>Inventory Count</o...

How can I find javascript method names in a file?

Hi everyone, Can any one help me in finding the method names using regular expressions in javascript files. ...

Missing file for Javascript debugging in Adobe Acrobat

Whenever I open a PDF in IE with javascript debugging enabled I get the following error message: "The file debugger.js is missing from the Javascripts folder. The Debugger will not run correctly without this file." I recently installed Adobe Acrobat 9. Where can I find this debugger.js file? It's nowhere to be found on my hard drive. ...

Problem preventing form submission with jquery

I wish to execute a jquery based ajax form submission on pressing the enter key. Obviously this involves stopping the normal form submission process. My form consists of a single input field. Here is the code: <script type="text/javascript"> $(document).ready(function() { // add vid ajax $.ajaxSetup({ cache:false; ...