?
Solved

Javascript errors

Posted on 2005-04-04
10
Medium Priority
?
586 Views
Last Modified: 2012-06-27
I'm getting a javascript error with the following code, but I can't see what's wrong with either the uncommented or with the commented out lines (it's being used with htmlArea3):

<script language="JavaScript1.2" defer>
//fieldname2="products_off_page_text[' . $languages[$i]['id'] . ']'";
//editor_generate(fieldname2);
editor_generate('products_off_page_text[<?php echo $languages[$i]['id']; ?>]');
</script>

Any clues please?
0
Comment
Question by:ncw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 25

Expert Comment

by:archrajan
ID: 13703061
check this
<script language="JavaScript1.2" defer>
//fieldname2="products_off_page_text[' . $languages[$i]['id'] . ']'";
//editor_generate(fieldname2);
editor_generate("products_off_page_text[<?php echo $languages[$i]['id']; ?>]");
</script>
0
 
LVL 1

Author Comment

by:ncw
ID: 13703077
Just tested it but there's no change.
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 13703120
perhaps, its difficult as I do not know what is being output.

<script language="JavaScript1.2" defer>
fieldname2="products_off_page_text[\' . $languages[$i]['id'] . \']'";
editor_generate(fieldname2);
editor_generate("products_off_page_text[<?php echo $languages[$i][\'id\']; ?>]");
</script>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:ncw
ID: 13704785
I guess it could be a bug in the generated output code (htmlArea).
0
 
LVL 1

Author Comment

by:ncw
ID: 13705435
Don't think there was anything wrong with the code except it was not required, think it was for htmlarea2 and not version 3
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13730771
does this

  editor_generate("products_off_page_text[<?php echo $languages[$i]['id']; ?>]");
need single quotes around the element ... so something like
  editor_generate("products_off_page_text['<?php echo $languages[$i]['id']; ?>']");

so if $languages[$i]['id']="bob";
output would be
  editor_generate("products_off_page_text['bob']");
instead of
  editor_generate("products_off_page_text[bob]");
0
 
LVL 1

Author Comment

by:ncw
ID: 13731452
HtmlArea 2 in osCommerce works fine with the following code with no double quotes:

editor_generate('products_description[<?php echo $languages[$i]['id']; ?>]',config);

The reason for the js error was that HtmlArea version 3 doesn't require this function call, at least not in the location I had it.
 
0
 
LVL 1

Author Comment

by:ncw
ID: 13731488
Thank you for your comments, however I've requested that this question be deleted since I've solved the issue.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 13758453
The question has been PAQ'd and the 125 points have been refunded.
RomMod
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

771 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