What's a good tool to create a regression test for JavaScript app?I could probably write a bookmarklet or something running from another frame, but I am hoping there is already existing tools for this.
here when i click the test button it will create a new test button inside div tag.But after that if i clicked new generated test button document.getElementById("test" ).onclick = function() is not working.how can i add functions to new dynamically created fields?
find a similar template on the web. I couldn't.A list of checkbox options:
1. Water 2. Sand 3. Red paint
Submit button which brings results IF Water and Sand selected, result = Mud IF Water and Red paint selected, result = Red water The closest thing I got to was[URL] How would code for such a program look like?
is there a function that get the name of the first input field of the current form ?
in my example below I want create an array of form field name and in the onsubmit assign all element's name to create a simple iteration to test if some elements in my array, that must be required, are null:
something like function verify(array of string)and in onsubmit something like return onsubmit(field1,field2,field3....) Code:
I would like to create a html E-test form run on PC and the data will save into a file on disk. I search online for this function code but found that most the script only save the cookie, is it possible for javascript save form data to file? Here is the ideal for my survay form,
1. user click "start" button for the e-test,
2. user need to finish the e-test with in 20 minutes, after 20 minutes the form will auto submit and the data will save into file,
3. me will go to the file folder open it and print out the qestion and anwser.
4. The file will be detele after i print out and the next user can do the e-test again.
I got the time counter and the auto submit script. but i just have no ideal how to save the data into file.
I stumbled on this problem while testing StatusNet for our next release; we use jquery.form's .ajaxForm() to do various AJAX form submissions, including the primary message-sending form which includes a file upload control.
We've not seen problems before, but since upgrading from an old Form plugin version 2.17 to 2.49 a couple months ago, I've noticed our development branch no longer works properly in Opera: the actual submission goes fine, but we're unable to access the XML return data (which usually contains HTML fragments to put back into the UI).
I have a test case which demonstrates this at [URL] (source of the main page & submit handler are included there), using current jQuery 1.4.4 and jquery.form 2.52.
Under Firefox 4.0b10 and other browsers, the forms submit correctly, and we can read nodes and text out of the returned XML just fine.
But on Opera 11.00 and 10.63, the submission goes through but we get back an HTML document containing only "<head></head><body></body>". On Opera 9.63, it also includes the text "Blank page."
I tried to trace this down in jquery.form's history, and the trouble seems to have started around 2.39 with a commit ironically titled "iframe load fix (mostly for Opera)", which changes the event handling for forms submitted via iframe: from that version on, a 'load' event handler is added directly as an onload attribute on the iframe's source, whereas previously it was added with attachEvent or addEventListener.
It looks to me like the iframe is throwing a load event for the "about:blank" page, instead of for the submission.
I can revert back to 2.17 or another working version for now, but I'd like to make sure this is fixed upstream;
I'm using the standard module pattern and the problem is once you set a private variable, trying to test that object independently becomes a nightmare as the next test is polluted by the actions of the previous.So, the options are to have some reset method (which is horrible), setters on everything (defeats the point) or delete object and re-load script (hideous).
HAVE CLIENT-SIDE FORM COOKIE GET AND SET FUNCTIONS IN THE SECOND WINDOW DOCUMENT EXTERNAL JS.FILE OF A DUMY TEST SITE FOLDER ON MYCOMPUTER. IE8 THROWS 'SYNTAX ERROR' ON THE 'WINDOW.LOAD=FUNCTION, FIRST COOKIE FUNCTION HIGHLIGHTED'. CAN I ACTUALLY TEST COOKIES ON A TEST SITE ON MY COMPUTER WITHOUT THE SERVER (MYCOMPUTER) OR A DOMAIN NAME? YEAH NO HECKLING FROM THE PEANUT GALLERY.[code]...
The .find() method does not seem to match on input fields by using a class. The ti This problem seems to be only visible on input fields. The following is a demonstration of the issue:
I have the following code that test the target element of a mouse movement to check if its and Image and the Parent is a Div element. It works perfect in Fire Fox, however IE does not allow access to test the target against instance of HTMLImageElement or the Div Element.
Is there a property that I can use to get the object type that will return "image" or "div" or anthing else that I can use. The typeof function only returns "object" which is totally useless in my application.
DragObject.prototype.mouseMove = function(ev){ ev = ev || window.event; var target = ev.target || ev.srcElement; var dragObj = target.getAttribute('DragObj');
I have Javascript on my site and will not work at all if JS is disabled.How do I notify my users that the pull down menus use javascript and will not work unless they turn it on?
I have a form on a page that the user fills out. When he's done and it's validated, I need the contents along with some other stuff to be printed before it's sent to the server. To accomplish this I'm using window.open on the Print button, then I intend to reference the fields from the page which opened it using the window.opener.formname.fieldname.value .
Problem is I have couple sets of radio buttons on the form that was filled out and I would like to print all the radio buttons showing the selected one so that the user acknowledges on the hard copy what his choices were.
If I was doing it server-side(ASP), I'd test the value of the incoming form value by executing a function, and I'd like to do it that way too, but I can't seem to figure out how to do that without putting <SCR IPT>function...</SCR IPT> tags with every radio button <INP UT> tag.
This also applies to where I'd like to write the values as HTML.
Is there a way to test for security settings in a users browser AND their firewall. Lets say someone is using zonealarm. Is there a way to test for their setting in zonealarm, so I can then redirect them to a specific page.
The reason I am asking is that I have a flash front page. A user cannot see the page because he has his security settings set so that he does not see activex controls. I want to be able to test for those settings then redirect him to a static page.
I want to supply a button on my public web page if I have opened up my private web page, but disable it or remove it if the private page is shut down. Is this possible?
In other words, I often have a port open for a chat page and I use no-ip.com to do a port redirect. When the port is open, I want my public page to test the port when a user loads the page, and if the port is available, supply a button to click over to it.
When looping thru a group of elements and using getNamedItem('itemname').value there are some elements that are going to have a null value for that particular getNamedItem... the problem is that you cannot test this value to see if it's null because it generates an error instead, and the code does not continue: _allnames[_j].attributes.getNamedItem("onchange") is null
You cannot even test it for null like this: if (_allnames[_j].attributes.getNamedItem("onchange").value != null) { do something } This will also generate an Error instead of testing to see if it is null.
How do you test getNamedItem for null to avoid this error?
EDIT: It appears that the problem is limited to Firefox. It works fine in IE7, but the error occurs in both FF v3.5.4 and in v3.5.5!
In my example below, there are no elements that match, so you should see an alert box that says 'No match', but (using Firebug) you will see that an error is generated when it tries to find the value of onchange in the last input tag.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1250">
I am doing an image/data rotating script. I get the data from a XML. I parse that data and build the divs and such.Data Set 1 --- background image in a div, with a button and some text overlayed on the div. ... ... Data Set 4 -- etc..The thing is, I load the script and the div appears, BUT the text overlay appears first THEN the image pops up for the first Data Set. I can't have that. I need them both to appear at once.Is there a way to determine that a div background image is loaded?-- I have access to the prototype js library.
Say I have two sets of radio buttons. One is group name "location" and the other is group name "time".
Lets say location has 4 possible values and time has 2 possible values.
All location values should be both time values as a possibility except the last location value which should only be able to select 1 of the 2 time values.
How can I popup an error message if location has a certain value and time has a certain value.
I really don't know the operators to use. Please give sample code with operators if you can.
I don't know if there is such a thing as a if then radio selection or not but I figured javascript could do it instead.
And I'm testing if I have an attribute in the image tag like below. All is fine in FireFox but in IE it fails on the hasAttribute test. why IE is not accepting it?