javascript

Javascript regex to remove number, then a space?

How would I go about removing numbers and a space from the start of a string? For example, from '13 Adam Court, Cannock' remove '13 '. ...

Send another <input> value in Ajax file upload

here is my upload function function ajaxFileUpload(){ $("#loading") .ajaxStart(function(){ $(this).html('loading...'); $('#buttonUpload').hide(); }) .ajaxComplete(function(){ $(this).hide(); $('#buttonUpload').show(); }); $.ajaxFileUpload ...

Is it possible to limit the user to upload an image with fixed dimension?

Hi, Is there any Jquery Plugin to perform the image dimension operation on an image before being uploaded using uplodify. i want the plugin to check the image dimension with the fixed define size and then only process for uploading. right now i am doing it with PHP function, instead of server side validation i want to adopt the client...

Youtube video doesn't stop in IE if I hide its parent div

So for example I have a structure like this: Javascript function toggle(id){ var element = document.getElementById("id"); if(element.style.display != 'block'){ element.style.display = 'none'; } else { element.style.display = 'block'; } } HTML <div onclick="toggle('holder')">Toggle Video</div> <div i...

problem in javascript validation , how to make call to javascript from jsf/icefaces?

Hi, problem in javascript validation , how to make call to javascript ? <html> <head> <script type='text/javascript'> function validate() { alert('hi'); } </script> </head> < body> <ice:panelGrid> <ice:inputText/> ..... ... ... </ice:panelGrid> <ice:commandButton onclick="validate();"/> </body> </html> I am not ...

javascript template inheritance

In the Django framework, web page templates can inherit from other templates. In your child template, you define blocks of code which override like-named blocks in parent templates. I'm guessing there are other back-end templating systems which also work this way, but Django is the one I'm familiar with. Do any of the existing javascrip...

javascript plain text url parsing

I'm trying to search plain old strings for urls that begin with http, but all the regex I find doesn't seem to work in javascript nor can I seem to find an example of this in javascript. This is the one I'm trying to use from here and here: var test = /\b(?:(?:https?|ftp|file)://www\.|ftp\.)[-A-Z0-9+&@#/%=~_|$?!:,.]*[A-Z0-9+&@#/%=~_|$]...

How gmail open in iframe, and stop to redirect into parent page

I am using iframe to open any other page into my website but when i use gmail then its redirect to my top page, so how to stop gmail to redirect ...

Javascript onclick instead of onfocus, or triggering a onclick by function.

Hello All, I am trying to make a AJAX page that allows people to edit one field at a time, and save it. The page is made via a AJAX load, so I dont know all the field and DIV submit ID names. But the idea is they edit a field, press enter (or click Save) and it funs a function sending the ID of the DIV. So a onfocus will call the func...

help with this Rails code, plz (select and javascript)

hi guys, this is what I wanna do. i need to have a select with options and javascript in each one, **select...%>** <% @buscar.each do |j|%> <option value="<%= j.cedula_tutor1 %>" onclick="Datos2('j.cedula_tutor1');"> <%= j.cedula_tutor1 %> </option> <%end%> **</select>** this is what I has made in rails... <%=select("cedula_tuto...

jQuery Uploadify - Problem in Update Panel

I am using jQuery Uploadify and it doesn't re render the FileUpload control after UpdatePanel's updated. here's the js code: $(document).ready( function () { $("#").uploadify({ 'uploader': 'scripts/uploader.swf', 'cancelImg': 'images/cancel.png', 'buttonText': 'B...

Best javascript book (for an experienced coder)

Hello, i'm lookin for a good, short javascript book. I've more than 5 years programming intensely. The idea is a short (no more than 150 pages), concise (without all that stuff like 'what is a program, what does a good coder has to know, etc'). Something similar to "Scrum from the Trenches", a free online book about Scrum (Ok, this is...

Javascript - To combine or not combine, that is the question.

Ok, so I know that it's obvious to combine all of a pages Javascript into a single external file for efficiency purposes, but that's not quite the question here. Say I have Default.htm with a search field that has a little Javascript magic attached to it. Then I have Contact.htm with a contact form that has some Javascript magic attach...

assign value to javascript variable In C# CodeBehind.

How can i assign value to javasctipt variable from code-behind (C#)? <script type="text/javascript"> String.prototype.trim = function () { return this.replace(/^\s+|\s+$/, ''); }; function ConstantByCode(_Obj, _Div) { var pl = new SOAPClientParameters(); _Obj.value = _Obj.value.trim(); pl.add("Code", _Obj.value); pl.add(...

Javascript Book for free Download

i'm lookin for a good javascript pdf book. which i can download freely. ...

jQuery UI datepicker reinstantiation blues

I am having some trouble with jQuery UI's datepicker script and am hoping someone here may be able to help. I need to be able to dynamically create the elements that require the datepicker plugin, then destroy them, then re-create them. (I make heavy use of jTemplates for this.) Unfortunately, datepicker only appears to work the first...

Creating a dynamic one page web application

I would like to make a web application (PHP) that will have overlay container that contain dynamic fields/forms. I would like the user to complete the form but not be taken away from the main part of the page. Imagine, browsing a website and reporting a page error into an overlay but not being taken away from the page you were reading....

Take path from application root in javascript.

function detailed_link(cell_rowid) { var $tabs = $('#infrTab').tabs(); $tabs.tabs('select', 1); // switch to third tab~ objRowData = $('#' + pageGridId).getRowData(cell_rowid); //document.getElementById("Name").value = objRowData.amount; loadPage('Infringement/TaskDetail', 'taskDetails'); /* Path ...

CSS and JavaScript problem.

Sorry for my English. A friend of mine asked me to help him to build a HTML page. I just know a little bit of CSS, and know absolutely nothing about JavaScript or jQuery. All the code I wrote was from Google. You can get what I really want in the picture, and I just finish the first step, the rollover animation works now, you can downl...

Do external JS files get cached the same way images do?

If I have multiple pages that refer to a single pagehandler script, will the script be called from the browser cache if I navigate from one of these pages to another? ...