Forums / Templates, Stylesheets, Page Layout / on_loaded javascript not calling other funtions

on_loaded javascript not calling other funtions

Locked

Views: 1,349

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
2 May 2007, 7:41 PM
#1
graphichabit avatar

graphichabit

New Zenner

Join Date:
May 2007
Posts:
2
Plugin Contributions:
0

on_loaded javascript not calling other funtions

I have this:
/includes/modules/pages/index/on_load_assign.js
with this:

first_assign();
```and I have this:
/includes/modules/pages/index/jscript_assign.js
with this:

function first_assign() {
alert('assignments called');
}

<script type="text/javascript" src="includes/modules/pages/index/jscript_assign.js"></script> </head> <body id="indexBody" onload="first_assign();"> ```If I'm reading it right, when my page loads an alert box should pop up that reads "assignments called". But it's not doing that. Any ideas why?

When I change on_load_assign.js to a simple alert function it works fine, but it doesn't seem to be able to call the outside function.

2 May 2007, 7:46 PM
#2
graphichabit avatar

graphichabit

New Zenner

Join Date:
May 2007
Posts:
2
Plugin Contributions:
0

Re: on_loaded javascript not calling other funtions

I lied.

I had other stuff in my jscript_assign.js. It didn't look like it would interfere, and my webmaster toolbar didn't flag any javascript errors on the page, but it must have been doing something.

I took out everything so that it exactly mirrored this post and it worked fine. I'm going to add stuff back in now and hopefully it will work.