I've recently updated from HTMLUnit 2.4 to 2.5 (we'd go for the latest version but there is a lot of code to refactor due to the deprecated APIs). I'm now having a problem with some JavaScript that opens a window.
The page under test, is a 'Please wait while loading screen' for reports. The page opens a new window then redirects back ...
For some reasons, unknown to me, prettyPhoto is loading images in reverse. It opens the last picture first and then as you can guess, you're given the option to see the previous photo all the way back to the first photo. I've setup prettyPhoto according to the documentation however I'm not getting the desired effect. Not sure what I'm do...
Not sure of the best way to ask this question other than:
I'm writing a function that will accept a variable called 'x'.
function doIt(x){
var y = someformula; //this is just a placeholder for the correct formula
return y;
}
And here's what I expect returned:
if (x is between 0 and 9){ y = 0; }
if (x is between 10 and 19){ y = ...
I am trying to get this form to:
if any $_POST vars equals any other of the $_POST vars throw an error.
if it was just a few it wouldnt be an issue but I have about 20 or so
so if i wanted to do it I would have to go like
<?php
if($_POST['input1']==$_POST['input2'] || $_POST['input1']==$_POST['input3']){
die('whatever');
}
...
I would like to know why this page's source use all this if-else to add an event listener:
if (document.addEventListener)
{
document.addEventListener("keydown",keydown,false);
document.addEventListener("keypress",keypress,false);
document.addEventListener("keyup",keyup,false);
document.addEventListener("textInput",textinput,...
I have this code: [it is a rough example with poor coding, but it illustrates what I want to do.]
<html>
<body>
<script type="text/javascript">
function fun()
{
var divs = document.getElementById('hi');
divs.innerHTML = divs.innerHTML.replace("cake","jump");
alert(divs.innerHTML);
}
</script>
...
I'm trying to load an image with JQuery like so:
function loadImage( path ) {
var img = new Image();
$(img)
.error(function () {
alert('Error loading image');
})
.attr('src', path );
}
I'm wondering if I am able to change the Accept HTTP header before the image is loaded because the API for the images requires it.
...
hi,
I have text box called "userInput" and one submit button.I want to print the value of the text box which is entered by user like a stack(previous values also,not just the current value).
any idea..??
<input type="text" name="userInput"/>
<input type="button" name="sub" value="submit">
Thank in advance!
...
If I have a function like this:
function foo()
{
//...
return false;
}
I can call it like this:
<a href="#" onClick="foo()">Run Foo</a>
However, in all browsers, this puts an # in the URL which I do not want.
So instead I do this:
<a href="javascript:foo()">Run Foo</a>
Which works fine in chrome but in IE it loads a pag...
I have a swf that opens up inside a colorbox window. When the video finishes playing, I make an externalinterface call to a javascript function to close the colorbox.
I'm trying to execute the following AS3 code:
ExternalInterface.call('parent.$.fn.colorbox.close()')
I can't seem to get this to work. The colorbox won't close.
I also ...
I'm using this code:
$newFilter = getNewFilter();
$fieldDropdown = getFieldDropdown(fieldData.field);
$newFilter.append($fieldDropdown);
$typeDropdown = getTypeDropdown($fieldDropdown.data('zenfilter').fieldId, $fieldDropdown.val(), fieldData.type);
$newFilter.append($typeDropdown);
$inputBox = getInputBox($typeDropdown.data('zenfilt...
I have a number of jQuery scripts that select elements within the area that I run a partial page refresh on.
I am using this css tricks code snippet to refresh that part of the page:
$('#refreshbutton').click(function() {
var url = "http://myUrl.com/indexTest.php?ID=" + Math.random();
setTimeout(function() {
$("#maindispl...
Is there any way to use ASP.NET's 'web application root' operator ~ in a script tag? If not, is there any way to mimic such behavior?
My application uses nested master pages for different sub directories; A content page uses its directory-specific master page, which uses the root master page. I'd like to be able to include my <script> t...
How is it possible to execute JavaScript code on a specific page through a Firefox addon. I know I can use Greasemonkey but since I'm porting one of my Chrome extension, I want it to have the exact same features. So my question is, is it possible to execute JavaScript through a Firefox addon as if that JavaScript was executed in the page...
I am building on a standard form driven user login panel. Works well enough. All browsers recognize the pattern as a login panel and helpfully offer to store passwords. The way the user login information is then later recalled varies by browser. I focus here on FF, but the problem is universal.
Like any standard form, my login form ...
I have a textarea that I want to block input on if the entered characters reaches a max-length.
I currently have a Jquery script for the textbox that calculates the characters entered and want to add something that will block input in the textarea once 150 characters are entered.
I have tried using max-length plugins in conjunction w...
A client is looking to play a brief splash javascript animation whenever a user accesses their site for either the first time or after visiting another domain. So as long as they are not navigating within the site.
Essentially, I'm looking to set a cookie and delete it if they leave the domain or capture what's going on in the URL bar,...
I am using the hover function for mouse over in a menu. I have selected a particular element using it's class. To make changes to only that element and not all the elements with that class I can use 'this'. But I wanna make changes to the h3 tag inside that class element. Again the one I have hovered on and not all elements with that cla...
In javascript, as a script loaded from somer host, is there any way to know what server/host I was loaded from? I need to make additional ajax requests back to that host and would prefer to figure out the host dynamically.
So if you include a javascript file on a page
<script src="http://somehost.com/js/test.js"></script>
w...
firebug is complaining its there is a syntax error
if (document.getElementById("fromAddress").value == "") ||
(document.getElementById("fromAddress").value == "Enter Address, City, Directions") {
...