469,621 Members | 1,666 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,621 developers. It's quick & easy.

Why does a script tag under another script tag in FF not work?

Hi guys!

I have a problem with FF:
'<script language="JavaScript1.2">'+editor_generate('answer _'+num,direction)+'<\/script>'; \\work in FF
'<script language="JavaScript1.2">'+editor_generate('explai n_'+num,direction)+'<\/script>';does not work in FF

In IE all works perfect!

Any suggestions?
Oct 21 '10 #1
8 1204
londres9b
106 100+
What is <\/script> for?

Shouldn't it be
Expand|Select|Wrap|Line Numbers
  1. </script>
?
Oct 23 '10 #2
this is my full code of function:
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. var counter=0;
  3.  
  4. function add_line(table_name,initial_count,direction){
  5.     counter++;
  6.  
  7.     var num = eval( eval(counter)+eval(initial_count));
  8.     //target_div =  document.getElementById(name);
  9.     //target_div.innerHTML  += "<tr><td>1<td/><td>2</td><td>3</td><td>4</td></tr>";
  10.     var tab = document.getElementById(table_name);
  11.      var row = document.createElement('tr');
  12.      var cell = document.createElement('td');     
  13.      cell.innerHTML='<input type="checkbox" name="correct_'+num+'" id="correct_'+num+'"  value="1"  />';
  14.      row.appendChild(cell);
  15.      var cell = document.createElement('td');
  16.      cell.innerHTML='<input type="checkbox" name="comment_'+num+'" id="comment_'+num+'"  value="1"  />';
  17.      row.appendChild(cell);
  18.      var cell = document.createElement('td');
  19.      cell.innerHTML='<textarea rows="6" cols="55%" dir="'+direction+'" name="answer_'+num+'" id="answer_'+num+'" ></textarea>';
  20.      row.appendChild(cell);
  21.      var cell = document.createElement('td');      
  22.  
  23.      cell.innerHTML='<div id="feedback_textarea_'+num+'" style="display:none;" align="'+direction+'">'
  24.     +'<textarea rows="5" cols="35" dir="direction" name="explain_'+num+'" id="explain_'+num+'" >'
  25.     +'<s:property value="explain_text" /></textarea></div>'
  26.     +'<input type="button" class="button" value="<s:property value="feedback_button"/>"'
  27.     +'onclick='+"'"+'toggle("feedback_textarea_'+num+'",this,"<s:property value="feedback_button"/>","<s:property value="close_button"/>");'+"' >";
  28.  
  29.  
  30.      row.appendChild(cell);
  31.      tab.appendChild(row);         
  32.      '<script language="JavaScript1.2">'+editor_generate('answer_'+num,direction)+'<\/script>';//Work on FF and IE
  33.      '<script language="JavaScript1.2">'+editor_generate('explain_'+num,direction)+'<\/script>';does not work in FF but works in IE
  34.  
  35.  
  36.  }
  37.  
  38.  
  39. </script>
this is script tag in quotations so i need to write <\/script> otherwise no one of the browsers are not understand the code.

Any suggestions of problem?
Oct 24 '10 #3
drhowarddrfine
7,435 Expert 4TB
In your first example, you have a space in one of the arguments. Also, there is no such thing as Vscript.
Oct 24 '10 #4
Well, space is copy=> paste mistake from my code. Also if you want to use script tag in string quotation you have to use <\/script>!
Oct 25 '10 #5
Plater
7,872 Expert 4TB
I am abit curious why you need the script tags at all? You are already IN a javascript function yes?
Just run the code.
Oct 25 '10 #6
Well you right Plater
I remove script tags:
editor_generate('answer_'+num,direction);
editor_generate('explain_'+num,direction);
The same problem the first row is working in FF and second is not....:((
In IE all work perfect(Of course);
Oct 27 '10 #7
Plater
7,872 Expert 4TB
The good thing about FF is that it has an error console (probably ctrl+shift+j) that will show your error.
Then if you have trouble you can tell us exactly what the error is
Oct 27 '10 #8
Thanks with you help i found an error in my script
Thank a lot Plater!!!
Oct 28 '10 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Mipe | last post: by
11 posts views Thread by Jim | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.