javascript

Trigger procedure on textarea attribute value changes

Hi, I want to call user defined function, once <textarea> attribute values changes. Attributes like height, width and val() of <textarea> i.e. on content change. Your suggestion are welcome!!! Regards, -Pravin ...

RegExp for clean file and folder names

I'm building a File manager with jQuery. Users can create folders and upload files. I need a Regual Expression (javascript) to check if the entered folder-name or the uploaded file-name is web-save. (no special chars or spaces are allowed) The name should only contain alphanumeric values (a-z,A-Z,0-9), underscores (_) and dashes(-) ...

How can I find caller from inner function ?

<input type='button' id='btn' value='click' /> <script type="text/javascript"> var jObject = { bind : function(){ var o = document.getElementById('btn'); o.onclick = function(){ // How can I find caller from here ? } } }; jObject.bind(); </script> UPDATE I read some trick from here - http://www.mennovanslooten.nl/...

Set the name of a Jquery selector as a string in a variable

Hi, I'm quite a noob at Jquery but I'm trying to set a variable based on the name of a form element. I.e. variable = "someForm" based on this example: <form id="hello" name="someForm" > First name: <input type="text" name="firstname" /> Last name: <input type="text" name="lastname" /> Email: <input type="text" name="email" /> <input...

Calling Borland C++ Builder application from ASP.NET/C#

Hi, I'm new to Borland C++ Builder and the application that I'm working on has to be launched from a ASP.net application on click of a button. That ASP.net application is able to launch other EXEs (made in C#) but when my application is launched it crashes immediately with a msg "an error has is encountered, please tell microsoft about ...

Trigger a link in adjoining table cell using jQuery

I have an HTML table where the first cell of each row contains text and the second cell contains a link. Like so: <table id="foo"> <tr> <td>Some text</td> <td><a href="/path/to/file/"><img src="/path/to/image.jpg" /></a></td> </tr> ... </table> I have a hover effect on the first table cell and when a user clicks on the f...

Jquery Iterate over table and highlight cells that have changed

I have a table that is a history of a mysql record. I want to add a button that will highlight the changes. <table> <tr> <td>100</td> <td>200</td> <td>300</td> </tr> <tr> <td>100</td> <td>200</td> <td>600</td> </tr> </table> In this example the 600 would be highlighted as it was 300 and is now 600. UPDATE: Thanks, I shou...

jquery .addClass to future js generated html

I do something like this: $(".field-validation-error").addClass('ui-state-error'); and at some moment something like this happens $("body").prepend("<span class="field-validation-error">This field is required.</span>") I would like this new added element to have also the class 'ui-state-error' ...

Clustering Google Maps API V3

Hi All, Could u plz tell me how to find the pixel co ordinates of a marker in Google Maps API V3? ...

How to retrieve the Json variables from the AJAX Response.

When I tried to fetch the values from a Json response, I stucked up. Here is my code Code: $.ajax({ url: 'checkvotes.php', dataType: "json", success: function(data) { // want to fetch UP and DOWN variables from JSON here } }); AJAX Response from PHP {"sample":[{"id":"1","message":"my message","up":...

I have an iframe which content I need Google to index. Is this possible?

I have a classifieds website. The index.html has a form: <form action="php_page" target="iframe" etc...> The iframe displays the results, and the php_page builds the results for the iframe. Basically the php_page builds a table containing the results from a mysql db, and outputs it. My problem is that this doesn't get indexed b...

Find the list of defined sammy.js routes

Sammy.js is a controller library in javascript. But sometimes we have a 404 because our route doesn't seems to be valid to sammy. How to know which route are defined by Sammy.js in a page ? Something like the ruby on rails' rake routes. Like answers we can search on app.routes. So I have something like in coffee script : jQuery.each...

How to use $ for jQuery inside domready when prototype is using $ outside?

I'm unable to remove prototype from a JSF framework (RichFaces 3.3.3). And if I try noConflict and try to take over $ it breaks my application framework because its tightly coupled with prototype. So is there a way that I can do this: jQuery(function() { /* some code that within this domready function allows me to ...

JavaScript alert function behaviour

In ASP.NET, I am preventing default postback action when user presses enter while textbox control has focus. See the following piece of code $("#TextBox1").keydown(function(e) { if(e.keyCode == 13) { //alert("Hello"); return false; } }); This co...

innerHTML alignment question

Hi - I have some js code that brings in random images and text (captions). The captions are centered under the images and would like them left aligned -- can anyone tell me how I might edit the span.innerHTML =Shuffled[i].text; to make the text left aligned under the image? Thanks in advance if you can answer it! { var td = ...

div open itself in a new window from a jsp?

I have a jsp "template" view in which I am including content from several other jsp's. The content from the other jsp's is being included into a <div> in the template file. Inside the included jsp's I want to have a hyperlink called "popup" (or whatever). When this link is clicked, then the content of this included jsp is "popped out"...

split & showing value in javascript

i have one variable in javascript named itemid i.e. var itemid=document.getElementById('item_code').value; in item_code there is value in this format "1025*1" and i want to display only 1025 not whole in javascript div plz give me some idea, it is same as explode() in php but i want this in javascript to display in div ...

How to open the homepage in FULLSCREEN with javascript without opening a new window ??

How to open the homepage in FULLSCREEN with javascript without opening a new window ?? ...

Launch / Check application

I have the following script which I am using in an intranet environment: function LaunchApp(the_app) { var ws = new ActiveXObject("WScript.Shell"); ws.Exec(the_app); } This allows me to pass it an exe path to launch directly from a web page as long as internet explorer's intranet security settings are adjusted. The problem is...

How do I tell Netbeans that a section of code is Javascript?

I'm using the Zend Framework's javascript helpers of the form: <?php $this->headScript()->captureStart(); ?> //Javascript here <?php $this->headScript()->captureEnd(); ?> //Rest of view here The problem is that Netbeans keeps complaining about code problems in the block, because it thinks it's an HTML, rather than a Javascript, block...