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
Solved

Problem with javascript includes

Posted on 2008-06-11
2
1,729 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

809 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