SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Feb 9, 2007, 07:29 #1
- Join Date
- Jul 2003
- Location
- London
- Posts
- 75
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Javascript help, undefined but defined function
I've declared a function as shown in the below source snippet
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<!-- CSS Stylesheet -->
<style type="text/css">
/* snip */
</style>
<!-- / CSS Stylesheet -->
<script type="text/javascript">
<!--
var SESSIONURL = "";
var IMGDIR_MISC = "/3.5.x/forums/images/placebo_two/misc";
var vb_disable_ajax = parseInt("0", 10);
// -->
</script>
<script type="text/javascript" src="http://localhost/3.5.x/forums/clientscript/vbulletin_global.js"></script>
<script type="text/javascript" src="http://localhost/3.5.x/forums/clientscript/vbulletin_menu.js"></script>
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="external.php?type=RSS" />
<title>my story by Funky_monkey - General Poetry - Poetry</title>
<link rel="alternate" type="application/rss+xml" title="Creative Writing Peer Review System RSS Feed" href="misc.php?do=feed&type=rss" />
<style type="text/javascript">
/**
* Opens a window to show a list of people who have this piece as their favourite (misc.php?do=whofaved&PIECEID)
*
* @param integer Piece ID
*
* @return window
*/
function whofaved(pieceid)
{
return openWindow(
'misc.php?' + SESSIONURL + 'do=whofaved&p=' + pieceid,
230, 300
);
}
</style>
<style type="text/css">
/* snip */
</style>
</head>
PHP Code:Favourites: 1 [<a href="#" onclick="whofaved(24993); return false;">who</a>]
-
Feb 9, 2007, 07:43 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try using a <script> tag instead of a <style> tag to include your script code.
Birnam wood is come to Dunsinane
-
Feb 9, 2007, 07:51 #3
- Join Date
- Jul 2003
- Location
- London
- Posts
- 75
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks that fixed it. i should've tried that before. sorry.
Bookmarks