Forum: JavaScript / DHTML / AJAX 6 Days Ago |
| Replies: 2 Views: 324 Lifeworks,
In Javascript, you can indeed pass a function, both as an argument or as a returned result. This is because Javascript functions are "first-class objects" (see here... |
Forum: JavaScript / DHTML / AJAX 10 Days Ago |
| Replies: 4 Views: 380 Tekkno,
The code can be made much simpler by framing the whole thing inside one function, for example an anonymous window.onload function, like this:
var $ = function(id){ return... |
Forum: JavaScript / DHTML / AJAX 12 Days Ago |
| Replies: 9 Views: 462 CF,
That's outside my current experience, but must say it's a reasonable hypothesis.
I'm sure someone will have been there before you. and will be able to offer advice. If no luck here than... |
Forum: JavaScript / DHTML / AJAX 13 Days Ago |
| Replies: 9 Views: 462 CF,
That's a good point about line numbers. In standard trim, IE is not the best at being 100% helpful when debugging javascript.
There are several things you can do.
Install a debugger:... |
Forum: JavaScript / DHTML / AJAX 13 Days Ago |
| Replies: 9 Views: 462 CF, doctype looks ok.
I've had Prototype working in IE6, and I've not read anything aboubt IE7 being a probelm. That said, maybe worth your while taking a look at the Prototype site - I think... |
Forum: JavaScript / DHTML / AJAX 14 Days Ago |
| Replies: 9 Views: 462 CFrog,
First thing to check is that your document(s) have a valid doctype:
For HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE... |
Forum: JavaScript / DHTML / AJAX 16 Days Ago |
| Replies: 10 Views: 860 Weasel,
Everything works fine with javascript pasted back into the page but only after addressing NULL. Remember to inspect your javascript error console for error messages.
NULL does not... |
Forum: JavaScript / DHTML / AJAX 17 Days Ago |
| Replies: 10 Views: 860 onsubmit="return validate(this);" is totally correct (other than the fact that it's generally better to attach event handlers in javascript rather than HTML).
The way to read onsubmit="return... |
Forum: JavaScript / DHTML / AJAX 18 Days Ago |
| Replies: 10 Views: 860 Absolutely no good I'm afraid - reason being form.radChoice[0].value is guaranteed to be "S" and form.radChoice[1].value is guaranteed to be "N".
There's no point testing the values - they don't... |
Forum: JavaScript / DHTML / AJAX 19 Days Ago |
| Replies: 10 Views: 860 Unfortunately, you have to loop to pick up the checked value from a radio group. AFAIK, there's no convenient method as for select menus.
Try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0... |
Forum: JavaScript / DHTML / AJAX 19 Days Ago |
| Replies: 8 Views: 558 Doug,
I have the answer!!
Moz browsers don't play ball with an AJAX request unless it's truly asynchronous, whereas IE and Chrome (so you inform me) do.
Change the line... |
Forum: JavaScript / DHTML / AJAX 19 Days Ago |
| Replies: 8 Views: 558 You will have to do a couple of fixes : fileName for XMLFile in initPhotoShow |
Forum: JavaScript / DHTML / AJAX 19 Days Ago |
| Replies: 8 Views: 558 By "the served version" I mean what you see when you "view source" in your browser to see what's actually been served. You should typically do this a lot when page-building with a server-side... |
Forum: JavaScript / DHTML / AJAX 19 Days Ago |
| Replies: 8 Views: 558 <body onload="initPhotoShow("<?php $inStr=$_GET['showName']; echo $showName; ?>")"> looks very suspicious.
What does the served version of this line look like?
Airshow |
Forum: JavaScript / DHTML / AJAX 20 Days Ago |
| Replies: 5 Views: 415 jQuery, Prototype etc. are good but tricky. I encourage novices to learn JS basics before trying to use these libs. People can't run before they can walk.
My rules (only occasionally broken) : if... |
Forum: JavaScript / DHTML / AJAX 20 Days Ago |
| Replies: 5 Views: 415 ZVN,
As Pritaes said plus ......
Unfortunately, .getElementsByClassName is far from safe. Too many browsers don't support it. So you have to be a bit old fashioned and do it longhand with... |
Forum: JavaScript / DHTML / AJAX 24 Days Ago |
| Replies: 3 Views: 641 LizzyJo,
There's a whole bunch of syntax errors in the javascript - unbalaced parens and curlies, x - -.
Suggest you check the js error console or even better, install JSLINT (it's a !Yahoo... |
Forum: JavaScript / DHTML / AJAX 24 Days Ago |
| Replies: 6 Views: 740 I will try but please forgive me if my explanation is inadequate.
It's all to do with "scope". If you don't know what scope is, then research it. It's kind of fundamental to any programming... |
Forum: JavaScript / DHTML / AJAX 25 Days Ago |
| Replies: 6 Views: 740 Agent_C,
The line <script src="!Libs/jquery-1[1].3.2.min.js" type="text/javascript"></script> points to my local copy of jquery. You need to change it to whatever you normally use.
Airshow |
Forum: JavaScript / DHTML / AJAX 25 Days Ago |
| Replies: 8 Views: 726 CommDave
Aha, I undertstand now!!. The problem was that your question was posted as a "Code Snippet", which is not the normal way to ask a question on Daniweb. Maybe a moderator can change it.
... |
Forum: JavaScript / DHTML / AJAX 25 Days Ago |
| Replies: 3 Views: 641 LizzyJo,
You can't have miltiple statements of the form onload = function(){};. Each statement overwrites the previous one.
To define functions (in the global namespace) use the form function... |
Forum: JavaScript / DHTML / AJAX 25 Days Ago |
| Replies: 8 Views: 726 Maybe I'm being dumb but I don't get it.
That's a very ordinary piece of HTML that could have been written manually or generated by a script.
Why does this qualify as a Code Snippet? How does... |
Forum: JavaScript / DHTML / AJAX 26 Days Ago |
| Replies: 6 Views: 740 Agent Cosmic,
Personally I avoid setInterval in favour of repeated setTimeouts.
Here is a version of your code framed in a namespace pattern:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0... |
Forum: JavaScript / DHTML / AJAX 27 Days Ago |
| Replies: 3 Views: 695 Rouse,
Please, STOP CODING AND DO SOME READING - for about a day.
You need to look at the jquery documentation and some examples. In particular you need to learn how to frame your code in a... |
Forum: JavaScript / DHTML / AJAX 30 Days Ago |
| Replies: 7 Views: 499 XMLHttpRequest can behave either synchronously or asynchronously, as determined by the third parameter in the line of the form xmlhttp.open("GET", url, true);.
With synchronous behaviour,... |
Forum: JavaScript / DHTML / AJAX 31 Days Ago |
| Replies: 3 Views: 534 LizzyJo,
Consider this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Airshow ::... |
Forum: JavaScript / DHTML / AJAX 33 Days Ago |
| Replies: 3 Views: 611 Neogy,
First thing to try is to combine the two code blocks above into a single $(document).ready(function(){.....}); structure.
Airshow |
Forum: JavaScript / DHTML / AJAX 33 Days Ago |
| Replies: 2 Views: 688 Carl,
There's a number of things here ....
First - how to get the selected option's value from a select menu:
//within function calculatePrice
var menu = document.getElementById("state");... |
Forum: JavaScript / DHTML / AJAX Nov 15th, 2009 |
| Replies: 8 Views: 666 OK, here it is in "longhand".
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Moultrie... |
Forum: JavaScript / DHTML / AJAX Nov 15th, 2009 |
| Replies: 8 Views: 666 It was made with winrar and I changed the extension from .rar to .zip, which is normally OK. Try changing your local copy back to .rar and see if it that's any better. If not then I'll post the... |
Forum: JavaScript / DHTML / AJAX Nov 15th, 2009 |
| Replies: 8 Views: 666 Rblalock,
OK, a fully worked up version of your page is attached, complete with my calc() function and several events to stimulate it.
You will find exactly the same approach used here... |
Forum: JavaScript / DHTML / AJAX Nov 14th, 2009 |
| Replies: 3 Views: 626 Kadjii,
In a nutshell, you serve the page with <img> tags in all relevant table cells. Then, in response to whatever events, javascript changes the images by dynamically setting the <img>'s src.
... |
Forum: JavaScript / DHTML / AJAX Nov 14th, 2009 |
| Replies: 7 Views: 564 Mekmiotek,
I'm not too sure what's wrong there, however here's the whole page, significantly simplified to make it more understandable and maintainable.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML... |
Forum: JavaScript / DHTML / AJAX Nov 14th, 2009 |
| Replies: 7 Views: 564 Mekmiotek,
You're right about it being ridiculously long!! It's also ridiculously complex. I guess it was written some years ago. It's certainly not the way we write our javascript today.
The... |
Forum: JavaScript / DHTML / AJAX Nov 13th, 2009 |
| Replies: 7 Views: 564 Mekmiotek,
At line 71 try replacing
fwLoad[image]=new image; with
fwLoad[image]=new Image();.
Airshow |
Forum: JavaScript / DHTML / AJAX Nov 13th, 2009 |
| Replies: 8 Views: 666 Rblalock,
In my experience, the best approach for form calculations of this type is to have a single (or supervisor) function which performs all calcs throughout the whole form... |
Forum: JavaScript / DHTML / AJAX Oct 28th, 2009 |
| Replies: 7 Views: 516 Pleased to be of help Dangari. It seems that sometimes the blind can lead the blind. I will follow up "Jeremy Keith" myself.
Airshow |
Forum: JavaScript / DHTML / AJAX Oct 27th, 2009 |
| Replies: 7 Views: 516 You might want to research "HIJAX" which is an approach (like "AJAX" neither a product nor a language).
HIJAX gets a mention (but no more than that) in one of my reference books - "Beginning... |
Forum: JavaScript / DHTML / AJAX Oct 27th, 2009 |
| Replies: 7 Views: 516 Dangari,
I've not heard the term "degradable AJAX" and can only guess at what it might mean.
As Will G says, AJAX simply won't work at all if Javascript is turned off.
However, you may... |
Forum: JavaScript / DHTML / AJAX Oct 25th, 2009 |
| Replies: 2 Views: 613 Ali,
The problem may be that toggleBox doesn't actually have a toggle action. It shows/hides a dom element depending on what is passed to it as iState.
In other words, the reponsibility for... |