I have a form that accepts javascript which allows the use of document.write() and I want to validate the output of the javascript which may look like this:
var a = 'book1';
var b = 2;
document.write("</scr"+"ipt>");
document.write("<scr"+"ipt type='text/javascript'src='http://www.example.com/loader.js?mydoc="+a+"&page="+b+"'>")...
We have an administrative portal that our teachers constantly forget to download their latest PDF instructions before logging out and/or closing the browser window. I have looked around but can't find what I'm looking for.
I want to accomplish the following goals:
Goal 1
Before a user can close the browser window, they are prompted "...
Is it possible to create code regions in JS files in Visual Studio 2010?
This method works in 2005, but I can't get working in 2010.
...
I've got the following problem. In IE if a contenteditable element is nested inside a hyperlink, clicking on the element prevents the hyperlink default behavior, i.e. navigation to another document. In FF it works fine. How can I solve the problem?
Just removing the contentEditable attribute is not a solution since I want this behavior (...
Hi,
I have a json object returned from a third party api, it looks like:
{"version":"1.0","encoding":"UTF-8"}
I'm going to be working on my project without a network connection, so I have to do everything locally. How can I create an instance of a json object locally for testing? Say I copy the above string, can I do something like:
...
This is a new one on me.
In FF 3.6.3, use of the word 'script' in a tag id seems to make the id return null when searched on with document.getElementById.
Thus document.getElementById("blah_script") returns null from <div id="blah_script"></div>.
Understood that 'script' in general is a reserved word, but I didn't know it was so spook...
My document contains more than one forms. How can I get an array of all forms using prototype?
<html>
<head></head>
<body>
<form id="form1">
<!-- Other stuffs here -->
</form>
<form id="form2">
<!-- Other stuffs here -->
</form>
<form id="form3">
<!-- Other stuffs here -->
</form>
</body>
</html>
...
So in jQuery, I have a global variable "currentSubNav" that stores a current visible element. The following code executes on "mouseenter".
I need it to get store element's ID, check to see if there was one. If there wasn't, set the new visible element to the default.
$('#mainMenu a').mouseenter(function() {
var newName = $(this).at...
I am drawing on a canvas with the following line:
ctx.drawImage(compositeImage, 0, 0, image.width, image.height, i, j, scaledCompositeImageWidth, scaledCompositeImageHeight);
This code has executed error free on Safari, Chrome, Firefox (and even IE using google's excanvas library). However, a recent update to Chrome now throws the fol...
I have a (hidden) html select object in my menu attached to a menu button link, so that clicking the link shows the list so you can pick from it.
When you click the button, it calls some javascript to show the <select>. Clicking away from the <select> hides the list. What I really want is to make the <select> appear fully expanded, as i...
I'm trying to dynamically spawn a video element on a page using JavaScript.
JavaScript
<script type="text/javascript">
$(document).ready(function() {
var video = $(document.createElement('video'))
.attr('id', 'VideoElement')
.attr('controls', 'controls')
.attr('src', 'videopath.mp4') // Changed 'href' attribute to '...
Does anyone know how to print a stack trace in nodejs?
...
I am having a couple problems trying to manually insert some jQuery features into a wordpress theme. I have a lightbox wordpress plugin that is jQuery based that is working fine.
So if I manually load the jQuery script into wordpress the functions seem to work but instead of say a slide being hidden it is revealed when it should still ...
I'm trying clear the value of a lookup field via Javascript. I've tried this:
crmForm.all.new_mylookupfield.DataValue = null;
But that isn't working. I inspected the DataValue of the lookup when it was in fact cleared and it returned a null.
alert(document.getElementById("new_mylookupfield").DataValue == null); // true
I'm must be ...
In Windows Forms there's a BeginUpdate/EndUpdate pair on some controls. I want something like that, but for jQuery.
I have a div, that holds a div. like this:
<div id='reportHolder' class='column'>
<div id='report'> </div>
</div>
Within the inner div, I add a bunch (7-12) of pairs of a and div elements, like this:
<h4><a>Hea...
Is it possible to open a window from PHP that has predefined content? It's obvious how you can open a window from a javascript link that frames an existing page, or just do a target=_blank from a regular a tag that references an existing page. But I am generating a bit of content, and want that content to be opened in a new link (or stre...
Hi,
I'm thinking about creating a tool to visualize scientific data on a website. For this, the user enters some query string and out comes a simple (x,y)-plot (similar to this)
I know that using Matplotlib, one can generate graphics on the fly for python. However, this doesn't solve the need for some custom java-script code to display...
i have a parent window and a child window. in javascript, i want a function in child window to be called whenever the parent window loads a new page. i'd like to use something similar to jQuery's $(document).ready() so that I don't have to worry about whether the parent is done loading yet - but ready() only appears to fire when the wind...
I'm trying to integrate a Zen Cart site with Facebook Connect. So far, I've been able to get Zen Cart to recognize that the user has a facebook account and is logged in, but that's it. True authentication into Zen Cart eludes me because I can't figure out where a password could be stored and how to get it to Zen Cart to be compared with ...
I want to show different images in a DIV, the turn of an image depend on a random number.
The image name is like 1.gif, 2.gif, .. 6.gif
to do that I coded
var img = document.createElement("IMG");
img.src = "images/1.gif";
document.getElementById('imgDiv').appendChild(img);
but it does not replace the old image how ever it add an anot...