javascript

What's the reason behind to include a engine in Java to run JavaScript?

To let JavaScript able to run in server-side? If it's justified, what's the advantage? and any good application for such use? ...

how to access database through javascript?

I am creating one admin page where I have multiple textboxes.when I enter the userid in one textbox I want to display user name in next textbox when admin moves to next text box.for this I can use ajax or javascript? which one will be better?how can I do it through javascript. ...

KeyDown event is not firing second time.

In my masterpage, i'm having one textbox for searching purpose. if we press enterkey it is redirecting to some otherpage. But it is happening only one time. next time when i enter some text and press enter key, it is not going to the Keydown event handler. Code: javascript Code: function SearchQuestionsAndDisplay(txt, event) { ...

touchend event doesn't work on Android

Hi, I've just started looking at doing some basic mobile web development on the android and an writing a test script to investigate the touch events. I've run the following code in the android emulator, and the touchend event never gets fired. Can anyone tell me why ? I've tried in three versions of the emulator (1.6, 2.1 and 2.2) and...

Limit text area value and cut the rest

I have a textarea which users can enter some tags. I need to limit this tags to 20 tags. Tags could be enterer this way maytag1,mytag2,mytag3 What i wrote is this function function limitTags() { var tags = $("input[type=text][name=tags]").val() var tag = $.trim(tags); var selected = new Ar...

Why does '7' + 4 give '74', whereas '7' - 4 gives 3 in javascript?

I read this question in some post on SO, so please explain this. Thanking you. ...

mootools changing an elements inline css

I have some HTML that looks like this, <div id="mb_contents" style="visibility: visible; opacity: 1; width: 600px; height: 450px;"> I am trying to turn the visibilty to hidden using this js/mootools, $('mb_overlay').set('styles', { 'visibilty': 'hidden', }); However nothing seems to be working, am I missing som...

How to safely transfer reference to object across window?

I'm debugging a web application. Javasript in one window create one object and use it as argument to invoke global method in another window. Pseudo code is like below. var obj = new Foo(); anotherWin.bar(obj); In anotherWin, the argument is stored in global variable. var g_obj; function bar(obj) { g_obj = obj; ... } When oth...

jQuery: how to pick unique IDs ?

Hello. New to whole this jQuery (and javascript altogether, heh) and so far it's been excellent, but now I'm in a small pickle. Let's say I have list of forms generated from SQL database and every single one of them has to have unique id, so how I can select the specific item that is to be manipulated (changing values via php). the $("#...

Change ExtJS Grid Height in Javascript

How can I point at the object of a ExtJS Grid and manually set the height (in pixels)? For example, with this same: var grid = new Ext.grid.GridPanel({ store: store, columns: [ {id:'company',header: 'Company', width: 160, sortable: true, dataIndex: 'company'}, {header: 'Price', width: 75, sortable: true, rendere...

Extract title tags from normal text

I am working on one task, to extract title tag from given normal text ( it's not a HTML DOM ). I have below cases where need to extract title tag(s) : Case 1 : <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html> Expected : Title of the document Case 2 : <htm...

Problem in uploded website?

I built a static web site in urdu font via uni code, it is not working well, it is only open in IE8, firefox, not in safari and not in Google Chrome, In IE8, firefox not supporting to Font, it is working well at localhost. address is: http://jamia-siddiquia .org/ *WARNING: linked site is blocked by google due to supposed malware distri...

Some good websites to learn about JavaScript and programming architecture?

I'm not sure if 'architecture' is the correct term, but I've been looking for some articles online which talk about programming design and more about how best to use languages such as JavaScript in a code design sense rather than the actual syntax itself. I have found many websites but a lot seem to be very out dated, and I'm not sure w...

problem with enable/disable button using javascript

Im am trying to add a check box that will enable/disable the edit button. Im retrieving a price list and displaying it inside a table. When i add the javascript into the php code it doesn't work. Below is my code <table border="1"> <tr> <td width="100">Fee % </td> <td width="100">Price</td> <td width="100">Total</td> ...

javascript deleting the array of elements

hi, i am having 10 check boxes.if i click the value of the check box has to push to the array,if i unchecked the check box then the corresponding check box value has to be deleted from the array? pls...anyone give reply for this ...

Using facebook oauth 2.0 - How do I fetch the access token

Hi all! I am new to oauth and I'm trying to use facebook connect with my web-application. I have succeded in getting a verification token but my problem is "fetching" the access token. How do I fetch it? Facebook documentation tells me to fetch the access token with this URL: https://graph.facebook.com/oauth/access_token?' ...

Javascript match part of url, if statement based on result.

Here is an example of the url i'm trying to match: http://store.mywebsite.com/folder-1/folder-2/item3423434.aspx What im trying to match is http: //store.mywebsite.com/folder-1 except that "folder-1" will always be a different value. I can't figure out how to write an if statement for this: Example (pseudo-code) if(url contains http:/...

onkeypress return false does not work for space bar

hi, I have written a javascript on a button which blocks the keypress or keydown event on that control. It works fine with key like Enter but when I press space bar key it event gets fired. Do any one have solution for the same. Thanks, Piyush ...

jQuery issue - #<an Object> has no method

I've tried a veriety of jQuery plugins recently and I keep getting this error … … regardless of what plugin I try to use. I've checked the links to the JS files which are all there and working fine. I'm using Drupal if that makes any difference. I've run the plugins away from the main site to demonstrate that they are working and th...

Why is my Javascript validation not working?

<script type='text/javascript'> function formValidator(){ // Make quick references to our fields var username = document.getElementByName('username'); var password = document.getElementByName('password'); var email = document.getElementByName('email'); // Check each input in the order that it appears in the form! if(isAlphanumeric(u...