javascript

How can I get the value from a parent html page into a javascript popup page?

I have a php page where a date value is POSTed back to. From this php script, I want to forward that value to a javascript window. Can this be done? ...

Superfish dropdown issues

Here is my dilemma: I'm attempting to make my nav work for the site mobilityidaho.org. On the home page, there are no problems at all with superfish working properly. When you navigate to any other page, the CMS I am using launches a javascript file that attaches the class "selected" to the li's in my navigation. Superfish cannot handle ...

jquery html() not working

I have an input box created by jquery like so: val input = $('<input class="pick_date" ... />') but the .html() method on input does not return the string entered inside the $. does anyone know why? edit: Ah, I understand the problem. Is there a way to get the html representation of the entire input box and not just the entry? ...

parse a string and truncate it

I want to break the following string at the word To and then truncate the email address that follows at 15 characters using JavaScript. This is the sentence: Please email this card to [email protected] It should like like this: Please email this card to email@emailadd... ...

Multiple file selection for an upload control

Hi, I was trying to do something like this: http://www.element-it.com/Examples/MultiPowUpload/AdvancedHTMLinterface.html But in my search for information I found that is not possible to perform multiple file selection with simple HTML and JavaScript (and JSP in the server side). There is a way to do this without using Flash? A third pa...

JQuery Datepicker with generated DOM elements

I have a website that uses JQuery to construct a rather large table. When I try to select a set of input elements created this way by class and add a datepicker to them, nothing happens. The table is generated durinng document.ready(); is there a certain time I have to execute $('.date_pick').datepicker(); in order for this to work? I...

Does removing comments improve code performance? JavaScript.

Hi, Does removing comments from JavaScript code improve performance? I realize that this is not great programing practice as comments form an intrinsic part of development. I am just interested to know if they do in fact add some overhead during compilation. Thanks, Ron. ...

javascript regex: replace url text link with image,but not in html tags

Hi this is my pice of code: <div style="overflow: hidden; width: 445px;">[IMG]http://i29.tinypic.com/mydog.png[/IMG] tak si to http://i29.tinypic.com/mycat.png Lorem ipsum loremai <img width="15" border="0" align="middle" src="images/smejo.gif" valign="middle"/> <img src=http://www.example.com/index.png alt> <img sr...

Security Review of JavaScript Library

Hi, Can anyone suggest tools or an approach to doing a source code “Security Review” of some JavaScript libraries. Particularly Cross-site scripting (XSS) activities potentially left by an unscrupulous individual. Ideally a something like the “RATS - Rough Auditing Tool for Security” which can be used for JavaScript, which parses th...

How to pass a integer into a javascript function?

Hi I am getting a response from ajax request(done by jquery). I have a method that displays errors to the users. Sometimes though I have some other information coming along with the json request. So I don't want this info shown(where the rest of the errors are). So I figured since I always know the length of the json coming back I ca...

Whats the best way to send array of objects from javascript to webservice?

I have in my javascript these 2 functions "classes": // product class function Product() { this.id; this.qty; this.size; this.option; } // room class function Room() { this.id; this.type; this.products = []; } I have my js logic which fills rooms and their products. Now i want to send array of rooms to a webservice to do some...

weird AJAX error

why won't this work? function login(){ if(window.XMLHttpRequest){ ajax=new XMLHttpRequest(); }else if(window.ActiveXObject){ ajax=new ActiveXObject("Microsoft.XMLHTTP"); } ajax.onreadystatechange=validatelogin; params='name='+escape(document.getElementById('name').value)+'&pass='+escape(document.getElementById('pass').value); /*IT F...

Scope of jQuery each() function?

Hey all, I'm working with the jQuery ColorPicker widget - specifically exercising the ColorPickerSetColor function (just 'setColor' internally). Code excerpt: setColor: function(col) { if (typeof col == 'string') { col = HexToHSB(col); } else if (col.r != undefined && col.g != undefined && col.b != undefined) { col = R...

Highlight all data in a HTML Table

Is there a way to do a selection highlight over all elements in a HTML Table? I want to be able to have data displayed in a tabular form, and the user to be able to click a button to select the relevant data to copy and paste into the spread-sheet of their choosing. ...

Event detect when css property changed using Jquery

Is there a way to detect if the "display" css property of an element is changed (to whether none or block or inline-block...)? if not, any plugin? Thanks ...

Image overlay circle over circle

First let me tell you what I want to achieve. I want a layout as below(Replace the squares with circles): |------------| | |-------| | | | button| | | |-------| | |------------| It is a button inside a circle image. The button should also be circular in shape. How do I go about doing it? As in, is there a way to overlay one circula...

How can I get a variable from one form into a javascript popup window?

Using the code below, I'd like to post or get the value returned (date) into a javascript window so that I can run a query off of the value. Can someone please tell me how to do this? <form method="post" action="search.html"> <p style="padding:10px;"> <input type="text" id="date" name="date" value="" maxlength="10"><a href="javasc...

How to remove the hash from window.location with Javascript without page refresh?

So if I have http://example.com#something how do I remove #something? doing window.location.hash = '' removes the something, but leaves the # Edit: To be clear, I was hoping to accomplish this without refreshing the page ...

Frustrating problem with JavaScript's getElementById()

I'll firstly admit I'm a lot more productive when using jQuery, however I've been asked to implement a gallery written in vanilla JavScript. My normal javascript DOM skills are only average. This is the gallery I've been asked to implement http://sandbox.leigeber.com/slideshow/ Now I've chopped and changed it ever so slightly so it'd ...

How to compile/package an IE7PRO script as an IE plugin ?

Hi All, is it possible to compile and package IE7PRO scripts as IE plug-in ? I've already developed a script on GreaseMonkey that's working fine under Firefox, and I wanted to port that js script under IE. is there any tools or libraries that allows this kind of compilation (.js (IE7PRO) -> IE Plugin) ? is there any other solutions li...