Solved

Problem with javascript includes

Posted on 2008-06-11
2
1,730 Views
Last Modified: 2008-06-19
I have an issue with javascript includes that constantly gets me.

Whenever I include some javascript, then add another block of javascript code, it seems to 'forget' the first block that I have included.

The error reported is 'SWFObject is undefined'

I'm missing something obvious, but could somebody tell me what...

Thanks in advance.
<title>Test Site</title>
	
	<script type="text/javascript" src="swfobject.js"></script>
	
	<script type="text/javascript">
	function loaded()
	{
		var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
		so.write("flashcontent");
	}
	</script>
	
</head>
<body onload="loaded();">
 
	<div id="flashcontent">

Open in new window

0
Comment
Question by:jerute
2 Comments
 
LVL 9

Expert Comment

by:zemond
ID: 21758280
are u saying that

      function loaded()
      {
            var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
            so.write("flashcontent");
      }
      </script>

is causing


<script type="text/javascript" src="swfobject.js"></script>

to fail?
0
 

Accepted Solution

by:
jerute earned 0 total points
ID: 21758557
No, I'vve just solved that problem which was of my own making. I had a window.onload call in the first javascript block which was being over-ridden by the body onload call to the second block. DUH.

As for the swfobject is undefined, I've just re-written the code from bottom up and it is now working, so I still don't know where I went wrong.

Sorry for wasting your time, and thx.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question