Solved

Problem with javascript includes

Posted on 2008-06-11
2
1,731 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

752 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