Jump to content

Functioned undefined


bravo14

Recommended Posts

I have a .js file that is referenced in the page, but when I try and run the functions from it the debugger says that the function is undefined.

 

the HTML to load the js file is

 

<script language="JavaScript" type="text/javascript" src="http://www.starkeracing.co.uk/fullthrottle/library/club.js"></script>

 

 

the call to the function in the HTML

 

<a href="javascript:modifyClub(5);">Modify</a>

and the JavaScript file is

 

function modifyClub(clubId)
{
function code here
}

 

I don't understand why it is saying the function is undefined.

Link to comment
https://forums.phpfreaks.com/topic/285354-functioned-undefined/
Share on other sites

  • 3 weeks later...

Your javascript file has an error in it, right here:

	with (window.document.frmAddProduct) {
		
		} else if (isEmpty(txtName, 'Enter Product name')) {
			return;
		} else {
			submit();
		}
	}
Because of that, the entire file cannot be loaded and none of it's functions will be defined. You need to fix that error then it will define the function.

 

What you are doing is a poor practice also. There is no need to involve Javascript here as all you are doing is linking to another page. Just simply do:

<a href="index.php?view=modify&club=5">Modify</a>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.