javascript

XSS exploit when JavaScript is disabled

I'm getting pretty frustrated trying to make McAffee whitelist a supposed exploit on a site i work on. The issue is that their automated system has detected a supposed XSS exploit but the exploit only exists when JavaScript is disabled. Given the fact that you need JavaScript to be disabled for the exploit to exist then surely this means...

Unable to validate a form using Javascript; PHP redirect issues?

Hello, I've coded a simple form for a friend's hobby; basically, we are trying to guess the starting lineup for a couple of teams in the 2010 FIFAWorld Cup (just for the kicks). Anyway, I need to validate the following form. All the Javascript functions appear to function well because if i just call them outside of the tag, everything...

write data into <input type="file"> using js

I'm trying to assign the value of <input type="file" id="field1"> to <input type="file" id="field2">. I'm having the following code but it is not working as expected: <script type="text/javascript"> function test(){ var field_value = document.getElementById('file1').value; document.getElementById('file2').value = field_value; ...

How to embed and call a javascript script in a RichFaces/JSF page

Hello I've been looking around for a method to embed and call javascript functions in JSF pages. I'm also using RichFaces. To define the function, it appears I can do this in a cross-browser supported fashion: <a4j:outputPanel ajaxRendered="true"> <f:verbatim> <script type="text/javascript"> ...

Prompt user to "Open firefox" if the website is opened in "IE"

Hi , I have a website,which is "currently" designed & tested to work only on firefox.If user tries to open it in other browser then I want to show a popup saying "This site works best with Mozilla Firefox. We're working hard to add support for your favorite browser. Meanwhile, do try it with Firefox." Can we provide a buttion on clicki...

converting request parameters strings to JSON?

Possible Duplicate: Javascript / Jquery: $.param( ) inverse function Hi, I'm trying to do the inverse of the jquery param function, i.e. I want to convert a parameter string (e.g. "login=1&init=1") to JSON (so that it can be used with jquery). Is there an easy way to do this? ...

Iframe permission denied error when developing locally: what are my options?

Here's what's going on: I have an application A hosted on a.mycompany.com and an application B hosted on b.mycompany.com Application A contains an iframe containing a page contained in the application B. <!-- In A's index.html: --> <iframe src="http://b.mycompany.com/something.html" > I need to have either the parent talk to the ifr...

How do you create a round navigation system?

Hi. I need to create a round navigation system, similar to the round nav button on an iPod Touch (see image here: http://www.flickr.com/photos/37476174@N06/4668497237/). It needs to be JavaScript-based (not Flash). It would have different menu items around the dial. It also needs to be small (around 300px in diameter). Does such a JavaS...

Iframe designmode in Firefox problem

This works in IE, but in firefox it's very strange: If open it normally if firefox, the designmode doesn't work but if i put a breakpoint on this.editor.contentWindow.document.designMode = "On"; line, and then release it (after it breaks on it), the designmode works! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://ww...

Setting month and year values for the next 6 months in Javascript

Hi, I am using a rather nice iPhone date control for a iPhone only website I am developing: http://cubiq.org/spinning-wheel-on-webkit-for-iphone-ipod-touch One of the wheels I want to create is basically the next 6 months with the month and year displayed. To hard code this I used: var monthsYears = { '05-2010': 'Jun 2010', '...

jquery/javascript convert date string to date

I have a date string "Sunday, February 28, 2010" that I would like to convert to a js date object formatted @ MM/DD/YYYY but don't know how. Any suggestions? ...

event is not defined in FireFox, but ok in Chrome and IE

I generate HTML using jQuery: $("<a />") .append("demo") .click(function () { DemoFunc(event, value.Id) }) This works perfect for Chrome and IE8, but in FireFox I got an error: "event is not defined". I changed the code like this: .attr("onclick", "DemoFunc(event, " + value.Id + ")") It works for Firefox, but not for Chrome...

Preventing MicrosoftAjaxWebForms.debug.js from loading

I've got an ASP.NET web application, and I'm attempting to reduce HTTP calls to the server, so I'd like to not load things like MicrosoftAjaxWebForms.debug.js and MicrosoftAjax.debug.js. Script manager is used to form all of my external javascript files into one, and I'm concerned that this is causing other non-related libraries to be ...

How to set equal width on divs with javascript

I've got five rows that looks like this: It's an ul with lis. I want the first li "text" to be equal on all rows. To do this I need to look for the widest li, then apply the new with to all li's. (ul > li > span & ul) Text > Li 1 | li 2 | Li 3 Textlong > Li 1 | li 2 | Li 3 Short > Li 1 | li 2 | Li 3 Longer13456 > Li 1 | li 2 | Li 3 I...

How to change an HTML elements style, and then revert it onLoad() with JS?

Hi, I have a problem with a Lightbox type modal window not working properly with IE. I have identified the problem as being due to the style attribute of the hidden image as 'display: none'. This works fine in all other browsers. But for IE, I need to change the value onload to 'display: block' and then straight back to 'display: none...

Export Sigma Ajax Grid's data to XLS, XML and CSV

Hi, I'm using the Sigma Ajax Grid... When I click in the pdf export button, in PHP, I can access $POST['_gt_html'] with the grid content: Array ( [__gt_html] => <style type="text/css"> </style> <table id="grid" class="gt-table" cellspacing="0" cellpadding="0" border="0" ><!-- gt : head start --><tr class="gt-hd-row"><td class="...

Will Google Map JS API 3 require an API key?

I did not find any indication that I would need an API key, and in fact I am using it without one. Did they announce that they were doing away with API keys or that the key would be implemented later? ...

Does anyone know if you can get an API Key for javascript at Google WITHOUT a current URL?

I'm developing a webapp/website on my local machine and won't know the url I'm using for it, but I'd like to use Google's hosted javascript APIs. Anyone know how I'd go about doing this? ...

How to access proprietary .js file in Spring MVC?

Hi guys, I am newby in Spring, but have a task, and I am learning on the fly. I used Roo to generates for me part of the code, but now I have to make some dynamic list binding, which is done with form, popping-up in new window, and when the submit button is pushed I have to insert the new values in the parent window. For the purpose I...

Wrapping a table or DIVs columns to multiple rows

Hey, I'm working with a CMS that parses variables into content using placeholders, e.g. <td> [[TITLE]] <br /> [[DESCRIPTION]] </td> The problem is that this will make one long table row. Because of the way the code is written, I can't get it to insert a <tr> after every few columns. Is there any way to wrap the rows (even using DIVs ...