Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Javascript errors

Posted on 2005-04-04
10
Medium Priority
?
588 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
9 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
Independent Software Vendors: 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article discusses how to create an extensible mechanism for linked drop downs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one 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

572 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