vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Javascript help, undefined but defined function (https://vborg.vbsupport.ru/showthread.php?t=138919)

sabret00the 02-09-2007 09:54 AM

Javascript help, undefined but defined function
 
I've declared a function as shown in the below source snippet
HTML 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" id="vbulletin_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="EBS:L!VE Forums RSS Feed" href="external.php?type=RSS" />
<meta name="Copyright" content="Copyright sabret00the (c)2005" />
<title>my story by Funky_monkey - General Poetry - Poetry - EBS:L!VE Creative</title>
<link rel="alternate" type="application/rss+xml" title="EBS:L!VE 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)
*
* @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>

and here's the bit that calls the function
HTML Code:

                                        Favourites: 1 [<a href="#" onclick="whofaved(24993); return false;">who</a>]
however, my FF error console seems to think that whofaved is undeclared. what have i done wrong?

Adrian Schneider 02-09-2007 01:33 PM

<style type="text/javascript"> should be <script type="text/javascript">

Analogpoint 02-09-2007 04:02 PM

And of course th closing tag too, lest it be forgotten.

</style> => </script>

sabret00the 02-09-2007 04:54 PM

thanks folks. that was a silly one, i feel embarrassed.

Analogpoint 02-09-2007 05:05 PM

Don't worry about it, it happens to the best of us! :)


All times are GMT. The time now is 03:39 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01077 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete