Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: JScript error "Expected ;"


Message #1 by "slok" <slok00@y...> on Fri, 28 Sep 2001 22:55:47
Just figured it out. The "If" should be lowercase.



> Got the following error message
> ==
> Expected ';'
> /bakertaylor/category.asp, line 61, column 28
> If (String(label) == "Root"){
> ---------------------------^
> ==
> 
> 
> what could be the problem?
> My codes is as follows:
> 
> ===
> <%
> 
> 	
> 	var context = getSiteContext();
> 	var catalogid = context.getContext("catalogid", true);
> 	var catalog = context.getCatalog();
> 	var categoryid = context.getContext("categoryid");
> 	var campaignid = context.getContext("campaignid", true);
> 	
> 	var category;
> 	if (categoryid == null) {
> 		var path = context.getContext("path");	
> 		category = catalog.GetCategoryByPath(path);
> 		context.setPageContext("categoryid", category.categoryid);
> 		categoryid = category.categoryid;
> 	} else {
> 		category = catalog.GetCategory(categoryid);
> 	}
> 	
> 			
> 	var bBrowse = (context.getContext("browse") != null);
> %>
> 
> <p>
> 
> <%=category.description %>
> 
> <%
> var label = category.description;
> If (String(label) == "Root"){
> 	label = "All Books";
> }
> 
> %>
> ====

  Return to Index