Solved

Problem with javascript includes

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now