Search:
Type: Posts; User: DaveyErwin
Search :
Search took 0.01 seconds.
Thank you for the very clear
explanation it has removed
all confusion.
function isPrime(){var greet="hiyas";}
checkPrime = isPrime;
alert(checkPrime)//alerts function isPrime(){var greet="hiyas";}
so it seems
checkPrime and isPrime
refference the same object...
when calling foo as a constructor
this will refer to the newly
created object so yes
i beleive
calling foo as a constructor (creating a new object obj)
this === obj (the function is being...
var checkPrime = new isPrime(5);
checkPrime is not a reference to isPrime
checkPrime is a newly created object
I should have said ...
I would be interested to see
a simple example of script
being executed that is located
in a complete html/xhtml doc
that is loaded by the XMLHttpRequest
After the...
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Index page</title>
<script>
var urls = new...
No it is not isPrime,
it is checkPrime
function isPrime( num ) {
alert(this===window)//alerts true
}
isPrime( 3 )
this equals window Not isPrime
function isPrime( num ) {
this.obj = this;
The xml doc is a
seperate entity
from the html/xhtml
doc the html doc
wont run javascript
that is in the xml doc
can you build a very
simplified html that
loads an external file
which are parsed in the xmlResponse property
what does that mean?
how is it "parsed"?
<!doctype html>
<html>
<head>
<title></title>
<script type="text/javascript">
function load()
{
I believe your server
needs to send this header
'X-XSS-Protection: 0'
see if this thread describes
your situation
http://www.codingforums.com/showthread.php?t=253796
<!doctype html>
<script language="javascript">
var a='103333-7'
var b='103363-0'
var c='103331-2'
var d = '203331-2'
collapse(a,b,c,d)
collapse(a,b)
function collapse(){
var arg =...
This code shows that your use
of 'this' will refference the
window object which
has no style
property
<!DOCTYPE html>
<body>
<script type="text/javascript">
var inputCheck = document.getElementsByTagName("input");
for( i = 0; i < inputCheck.length; i++) {
inputCheck[i].onclick = function() {
this.setAttribute('select', 'ok');
}
}
He's pointing to tgis ...
function myFlag( state ){
var cp = this.constructor.prototype;
alert(this===window)
if( state !== undefined )
cp.flag = !!state;
return...
var calc = (function(){
var a;
var b;
return {
add: function(){
return a+b;
},
subtract: function(){
return a-b;
},
<!doctype html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type='text/javascript'>
var MyText;
function MyFunction(){
...
you have a timing problem
the var MyText is in
the global scope
however
you access it Before
jquery has updated it
here is the solution ...
because ...
function dog(name) {
this.name = name;
}
is the same as ...
dog = function dog(name) {
first this ,,,
var Dog, dog;
Dog = (function() {
function Dog(name) {
this.name = name;
}
I can help you get over all your confusion
if you will forget about classes totally,
there are no classes in javascript.
There are no classes in javaScript.
it is the same as
var Dog = function (name) {
this.name = name;
}