Jump to content

Recommended Posts

Hi i have an error in my script syntax error where it is marked.. can you assist?

 

 

$xhtml .= '<script>';

$xhtml .= 'function OnViewChanged(view)';

$xhtml .= '{';

$xhtml .= ' var ele = document.getElementById("callback");';

$xhtml .= '  ele.style.display="block";';

$xhtml .= ' elsif (view=="upload") ;ele.innerHTML="'.htmlentities(get_config('msg.upload',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="manual") ;ele.innerHTML="'.htmlentities(get_config('msg.manual',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="login") ;ele.innerHTML="'.htmlentities(get_config('msg.login',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="contacts") ;ele.innerHTML="'.htmlentities(get_config('msg.contacts',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="captcha") ;ele.innerHTML="'.htmlentities(get_config('msg.captcha',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="bookmark") ;ele.innerHTML="'.htmlentities(get_config('msg.bookmark',''),ENT_QUOTES,'UTF-8').'";';

$xhtml .= ' elsif (view=="finished") ;ele.innerHTML="'.htmlentities(get_config('msg.finished',''),ENT_QUOTES,'UTF-8').'";'; // syntax error here??

$xhtml .= ' else ele.style.display="none";';

$xhtml .= '}';

$xhtml .= '</script>';

Link to comment
https://forums.phpfreaks.com/topic/258672-javascript-syntax-error/
Share on other sites

Hi, thanks for the replying..

here is the outputed Script..

 

Error: syntax error

Source Code:

function OnViewChanged(view){ var ele = document.getElementById("callback");  ele.style.display="block"; elsif (view=="upload") ;ele.innerHTML=""; elsif (view=="manual") ;ele.innerHTML=""; elsif (view=="login") ;ele.innerHTML=""; elsif (view=="contacts") ;ele.innerHTML=""; elsif (view=="captcha") ;ele.innerHTML=""; elsif (view=="bookmark") ;ele.innerHTML=""; elsif (view=="finished") ;ele.innerHTML=""; //error is here

else ele.style.display="none";}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.