When using an src'd script, you MUST have a seperate closing tag.

You need:

<script src="..."> </script>


It's a stupid browser bug that hs been around forever, and will be
around forever.

On 12/7/07, Michael Nemtsev <[EMAIL PROTECTED]> wrote:
>
> Like <script src="..." />
>
> but does it make sense for RegisterStartupScript being blind for this
> inclusion?
>
>
>
> Michael Nemtsev
> ________________________________
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mitch
> Denny [EMAIL PROTECTED]
> Sent: Friday, 7 December 2007 12:04 PM
>
> To: [email protected]
> Subject: [OzMOSS] RE: RegisterStartupScript doesn't see the function from
> external JS file
>
>
>
>
>
> Hi Michael, how have you defined the of the script?
>
>
>
> <script src="..." />
>
>
>
> -or-
>
>
>
> <script src="..."></script>
>
>
>
> -or-
>
>
>
> <script src="..."> (no end tag)
>
>
>
>
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
> Michael Nemtsev
> Sent: Friday, 7 December 2007 11:52 AM
> To: [email protected]
> Subject: [OzMOSS] RE: RegisterStartupScript doesn't see the function from
> external JS file
>
>
>
>
> my startup script is inserting AFTER the inclusion of myscript.js, because
> it inserted into head in Sharepoint master page explicitly
>
>
>
>
>
> that seems to be the problem.
>
>
>
>
>
> need to think about neat way how to cope with this situation
>
>
>
>
>
> Michael Nemtsev
>
>
> ________________________________
>
>
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Matthew
> Cosier [EMAIL PROTECTED]
> Sent: Friday, 7 December 2007 11:47 AM
> To: [email protected]
> Cc: Neville Mehta
> Subject: [OzMOSS] RE: RegisterStartupScript doesn't see the function from
> external JS file
>
>
> You'll probably find that it's actually inserted the startup script prior to
> the inclusion of the myscript.js, or something like that (some type of
> ordering issue).
>
>
>
>
>
> For all javascript related issues/debugging, I recommend the usage of
> FireFox and the FireBug plugin.  You can then inspect the generated output
> much clearer, and determine if the ordering of your script is correct.
>
>
>
>
>
> Regards,
>
> Matthew Cosier
> Readify | Senior Developer
>
> M: 0401 932 250 | E: [EMAIL PROTECTED] | W: www.readify.net | B:
> http://cosier.wordpress.com
> ________________________________
>
>
> From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Michael
> Nemtsev [EMAIL PROTECTED]
> Sent: Wednesday, 5 December 2007 10:00 AM
> To: [email protected]
> Cc: Neville Mehta
> Subject: [OzMOSS] RegisterStartupScript doesn't see the function from
> external JS file
>
>
> Dear all,
>
>
>
>
>
> I've stumble over the strange problem that JS function can't see function
> from included .js file if it was called via RegisterStartupScript method
>
>
>
>
>
> I have the page with "mysript.js" file included, which has a
> "prepareToWait()" function implementation.
>
>
> In the codebehind class I created the another function which I wanna
> register as a startup script, and in this function I call my
> "prepareToWait()" from included file.
>
>
>
>
>
> So, I have smth like
>
>
>
>
>
> string initscript = "function runOnLoad() { prepareToWait(); ..<calling
> other functions>;
> _spBodyOnLoadFunctionNames.push('runOnLoad');"
>
>
> Page.ClientScritpt.RegisterStartupScript(GetType(),
> "Startup", initscript, true);
>
>
>
>
>
> but after calling this I have an exception on prepareToWait(); that it can't
> be found.
>
>
>
>
>
> what could be the reason of that strange behaviour that sharepoint page
> can't see my function?
>
>
> Other functions from mysript.js , which are not called via
> RegisterStartupScript,  work fine on that page
>
>
>
>
>
> ---
>
>
> Michael Nemtsev
>
>
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
>
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net
> -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com - List managed by www.readify.net


------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net


Reply via email to