I believe javascript can be anywhere (almost), but I almost always see it in between <head></head>. I am using jquery and wanted to know if it has to be in the head tags for some reason or if will break something if I move it. Thank you.
EDIT: Why is it almost always in the head tags?
...
MY javascript: Updated Again.
$('.calc').change(function(){
var classArray = $(this).attr('class').split(',');
$.each(classArray, function(){
alert(classArray);
});
});
And the input:
<input type="text" class="calc R#r# C#i#" />
The pound signs are variables, I'm using ColdFusion.
What I need to be able to do ...
I have the following plugin, which takes a partial game name, bounces it off our DataQuery object to get a list of items from the server (basic autocompleter/selector).
The problem I am having is this.
I am using it on a page, where the selector appears in a dialog box. When the user is done, I 'destroy' the selector, and then recreate...
I have a collapsible panel extender. I have no issues with the extender. however, I have a link that opens the panel and I want another link saying collapse to close it. I want to hide one show one javascript side. The issue is that it only works for the first row but not the others because I am not getting the unique ID or something. I ...
I'm using Dojo toolkit version 1.3.1. I have defined the following dijit in a jsp page:
<div dojoType="dijit.layout.BorderContainer" gutters="false" id="ui_container">
<div dojoType="dijit.Toolbar" region="top">
<div dojoType="dijit.form.Button" id="zoomin" iconClass="zoominIcon">Zoom In</div>
</div>
<div dojoType="d...
I have a page with 2 forms and a hidden field that is outside of both of the forms.
How can the hidden field be submitted with either of the forms?
I thought about doing something like this with jQuery:
<script type="text/javascript">
$(function() {
$('form').submit(function() {
// do something to move or copy ...
function msg ($msg) {
echo "<script type='text/javascript'>alert('$msg');</script>";
}
if (count($_POST)) {
msg('TEST!!!!!');
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" con...
When my iframe's onReady-event is fired, I draw a flot graph in it (the iframe is inside an ext component). But the graph gets drawn with the wrong spacing (labels are in the wrong place - either to far away from the axis or on the wrong row, both causing those annoying scroll bars to show up). However, the graph redraws itself correctly...
var total = 0;
$(".amount").each(function() {
var value = $(this).val();
value = (value.length < 1) ? 0 : value;
var tmp = parseFloat(value).toFixed(2);
total += tmp;
});
$(".total").text(total);
I am trying to loop through some text boxes and sum up their values....
I have some javascript which parses an ISO-8601 date. For some reason, it is failing for dates in June. But dates in July and May work fine, which doesn't make sense to me. I'm hoping a fresh set of eyes will help, because I can't see what I'm doing wrong here.
Function definition (with bug)
function parseISO8601(timestamp)
{
var ...
Found the answer. Take a look if you're interested.
Changed my approach to completing this project.
Need to be able to calculate rows to "Total" on the right hand side and the columns to "Daily Totals"
I've been able to get some of it working, but it's screwy with the calculations and can't be right.
Grand total seems to be working,...
The page here (http://skergeth.net/slidingfooter/) contains a footer that slides up when you click on contact us. It then shows a contact form.
However in IE8 it slides up and the div containing the form stays white until it is hovered by the mouse.
I also tried the approach that the footer-div has overflow:hidden but since there are ot...
I have some code that I would swear was working a month ago. However, now the code throws a
permission denied to get property Window.jQuery error. I can see this error in the Firefox error console.
The code in question belongs to a window that was opened via JavaScript. This code attempt to update the contents of a DIV in the opening ...
Hello,
I am trying to figure out how to programmatically add an event handler to a JavaScript object. More specifically, I am trying to add an event handler to the onunload event of a window object. I am trying it like so with out any luck:
var url = "www.somelocation.com";
var specs = "location=0,menubar=0,status=0,titlebar=0,toolbar=...
is there a way to iterate an object properties and methods. i need to write a utility function like so:
function iterate(obj)
{
//print all obj properties
//print all obj methods
}
so running this function:
iterate(String);
will print:
property: lenght
function: charAt
function: concat...
any ideas?
...
Prototype's Template class allows you to easily substitute values into a string template. Instead of declaring the Template source-string in my code, I want to extract the source-string from the DOM.
For example, in my markup I have an element:
<div id="template1">
<img src="#{src}" title="#{title}" />
</div>
I want to create the ...
In JavaScript, how can you select text on a website, copy it (by Control+C, Command+C, or Edit Copy) and have JavaScript append a line or two to the clipboard so when the user pastes, the content they copied is shown as well as the extra line?
Also, would this be possible to do only within certain <div>s of the site? If so, how?
...
I like how Facebook keeps that toolbar on the bottom of the page.
Does that require cross-browser ninja skills?
Their JavaScript/CSS files are huge so I am having a hard time narrowing down the implementation (for learning purposes).
...
Whew... I have asked several questions today until I have just now figured out what the problem actually is. The problem is related to cross-site scripting. Here is my scenario.
I have a web application that launches a dialog window using window.open function in JavaScript. This window redirects the user to the Twitter OAuth login page....
Im using aspnet 3.5, vs 2008, ajax 2.0, plain old javascript (not using any javascript framework).
In a asp:listview i have a button (delete) with a OnClientClick= "turnrowpink(this);"
I also have an ajax 2.0 confirmbuttonextender for this button ( are you sure you want to delete this record? )
The turnrowpink function used to run be...