javascript

Limit File Types Shown in Browse Window

Hello all, Is there really NO WAY AT ALL to limit the file types that are shown in a browse file window? I tried this: <input type="file" accept="text/xml" name="parameter_file" /> Firefox, IE just ignore it. I found the below excerpt from another question: Accept attribute was introduced in the RFC 1867, intending to enable ...

Retrieve if an Updatepanel has made a postback

Hey, Can somebody tell me if I can retrieve with JavaScript above the ASP.NET Updatepanel had made a asynchronous postback ? Thank's for help ! ...

Simple PHP Counter Script with JS Prompt Values

Hi friends I need a simple php script like it should start with myname01 to myname-9999999 numbers. But it should be like this 01 02 03 04 . . . . 9999999 And on a button click I want to some like this. user is given a javascript prompt to enter desired counter value Like if the user put value 4 in the js propmt then my php co...

Why $('a.current').removeClass('current'); is not working?

Why $('a.current').removeClass('current'); is not working for this jquery tabs? http://jsfiddle.net/laukstein/ytnw9/8/ //full JS in http://jsfiddle.net/laukstein/ytnw9/8/ $(function(){ var list=$('#list'), elementsPerRow=-1, loop=true, // find first image y-offset to find the number of images per row topOffset=lis...

Validate an image path in javascript

I have an image like: img src="" class='listPartialLoader' alt='loading' I am assigning the 'src' value with data from an ajax call. Some times if the image is not found I want to add a default image path like"Images/default.jpg". But how can I check whether the image is exist or not using javascript? (Basically I want if the image is ...

Make .find non case sensitive

I can currently using: $results.find('a[href$=".doc"]') to find anything ending with .doc for editing reasons. However, this seems to be case sensitive, i.e. if a document ends with .DOC or .Doc, it will not find those. Is it possible to make this non case sensitive? ...

running Javascript through IE via PHP

I need to run a javascript code on server side using IE8 (the javascript works with activeX objects) But I need to run it from command line, from PHP. So in short, I will install apache + php on 2003 Windows server, and php will use system() to execute iexplore running a page of javascript. I would like to know if this is logically pos...

Pre-rendering html page into image

I want to pre-cache next web page into a thumbnail. Is it possible to pre-render a html page (with css) into an image on-the-fly with javascript/jQuery? And how to persist that temporary image on the client? ...

Change case using Javascript regex

How to change case of some backreference in String.replace()? I want to match some part in text and change its case to upper/lower. ...

JavaScript Event Handler in ASP.NET

I have the following iframe control (intended to be a facebook like button): <iframe id="likeButton" src="http://www.facebook.com/plugins/like.php?href=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" onprerender="setupLink()" </iframe> I have the java...

Python to javascript communication

OK so im using websockets to let javascript talk to python and that works very well BUT the data i need to send often has several parts like an array, (username,time,text) but how could i send it ? I originally though to encode each one in base64 or urlencode then use a character like | which those encoding methods will never use and the...

dynamic svg favicon?

i have an icon in the SVG format. i want to have it in different colors as favicon. how to reach this? since there isn't any toDataUrl() for SVG elements i don't see any solution without a server round trip. i would even say that it isn't possible, but hopefully i'm wrong any idea for a client side solution? it doesn't need to be cross...

regex case insensitivity

How would I make the following case insensitive? if ($(this).attr("href").match(/\.exe$/)) { // do something } ...

Debugging issues : detect where my focus is with jQuery ?

Forcing focus() on an element is easy, but after having debug issues, I realize trying to determine where is my focus gone is a lot harder. thing is I'm generating a modal window using jq.UI, and from time to time, while focus is supposed to be set on first input of the form inckuded in the modal, cursor just disappears, to never show ag...

Problem with JWplayer onComplete event (browser freezes, only Ctrl+Alt+Del helps)

So I got JWplayer 5.3 up and running with this HTML: <!-- START OF THE PLAYER EMBEDDING TO COPY-PASTE --> <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="720" height="480"> <param name="movie" value="player.swf" /> <param name="allowfullscreen" value="true" /> <param name="all...

Modify object using jQuery.map?

I have a key-value pair like var classes = { red: 'Red', green: 'Green' }; How can I prepend each of the keys with a specific value? Could this be done using jQuery.map? The final result I'm looking for is classes = { 'a-red': 'Red', 'a-green': 'Green' }; ...

document.getElementById('grand_total_display').innerHTML = "Total is : $"+variable; is displaying error in IE6 and IE7

document.getElementById('grand_total_display).innerHTML = "Total is : $"+variable; is displaying error in IE6 and IE7 I have an <li>with id as grand_total_display with some text displayed in it. <li class="bannerprice" id="grand_total_display">TOTAL PRICE : $0</li> I am executing a jjavascript function to insert some other value int...

How to trigger CTRL+C Keyevent width Jquery?

Hi, I want to simulate a ctrl+c to copy the text into it. I first tried this: $('#codetext').click( function() { $("#codetext").trigger({ type: 'keydown', which: 99 }); } HTML: <input type='text' id='codetext'> I have also tried using $(this) instead of the selector, but the input element also has focus on it, does...

Calling an exe from JavaScript (need to change current directory)

Hi, I'm calling an exe from within an html page using Javascript. The problem is my EXE has some dependencies which are referred from current directory. Therefore, I need to change current directory to the EXEs directory, and after calling the exe it should be changed back to previous one so that nothing else is effected in later steps....

Packaging Javascript files in a war?

I am developing a Servlet based Java project which is to be packaged as a war using Maven. Is there a way I can include JavaScript (JS) files along with this project (they should be available at some url when the project loads on a Tomcat Server). I have looked around but have not found any working solutions. ...