- Posts: 36
- Thank you received: 0
JavaScript Syntax Error
-
somedudefred
Inactive member - Topic Author
- Member
Less
More
10 years 11 months ago #35891
by somedudefred
JavaScript Syntax Error was created by somedudefred
While trying to resolve why lightbox does not work, my browser's JavaScript console pointed me to a 'syntax error' at this line ... BoxHeights.equalise(,'c2','c3'); ...just after the beginning parentheses.
Is there something missing here in the code? Should it be 'c1'? If yes, where can I edit this code?
Thank you.
Below is the code copied from the page debugger...
<!-- equal heights -->
<script type="text/javascript" src="/hsr/templates/hot_restaurant/js/equal_heights.js"></script>
<script type="text/javascript">
window.onload = function() {
BoxHeights.equalise(,'c2','c3');
}
</script>
Is there something missing here in the code? Should it be 'c1'? If yes, where can I edit this code?
Thank you.
Below is the code copied from the page debugger...
<!-- equal heights -->
<script type="text/javascript" src="/hsr/templates/hot_restaurant/js/equal_heights.js"></script>
<script type="text/javascript">
window.onload = function() {
BoxHeights.equalise(,'c2','c3');
}
</script>
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago #35902
by ivan.milic
Replied by ivan.milic on topic JavaScript Syntax Error
In index.php of template:
<script type="text/javascript">
window.onload = function() {
BoxHeights.equalise(<?php if($showuser[5]) { ?>'c1'<?php } if($showuser[6]) { ?>,'c2'<?php } if($showuser[7]) { ?>,'c3'<?php } ?>);
}
</script>
change that to:
<script type="text/javascript">
window.onload = function() {
<?php
$tmp = array();
if($showuser[5]) $tmp[] = "'c1'";
if($showuser[6]) $tmp[] = "'c2'";
if($showuser[7]) $tmp[] = "'c3'";
?>
BoxHeights.equalise(<?php echo implode(",",$tmp); ?>);
}
</script>
<script type="text/javascript">
window.onload = function() {
BoxHeights.equalise(<?php if($showuser[5]) { ?>'c1'<?php } if($showuser[6]) { ?>,'c2'<?php } if($showuser[7]) { ?>,'c3'<?php } ?>);
}
</script>
change that to:
<script type="text/javascript">
window.onload = function() {
<?php
$tmp = array();
if($showuser[5]) $tmp[] = "'c1'";
if($showuser[6]) $tmp[] = "'c2'";
if($showuser[7]) $tmp[] = "'c3'";
?>
BoxHeights.equalise(<?php echo implode(",",$tmp); ?>);
}
</script>
Please Log in to join the conversation.
-
somedudefred
Inactive member - Topic Author
- Member
Less
More
- Posts: 36
- Thank you received: 0
10 years 11 months ago #35934
by somedudefred
Replied by somedudefred on topic JavaScript Syntax Error
Thank you for your quick reply!
After switching out the code I ran the debugger again in IE8 and received another error (see attached image).
Just out of curiosity... Which boxes is this script trying to equalize?
Thank you again for your help.
After switching out the code I ran the debugger again in IE8 and received another error (see attached image).
Just out of curiosity... Which boxes is this script trying to equalize?
Thank you again for your help.
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago #35945
by ivan.milic
Replied by ivan.milic on topic JavaScript Syntax Error
Can you check then in IE debugger if this file loads:
templates/hot_restaurant/js/equal_heights.js
That happens only for IE8 ?
templates/hot_restaurant/js/equal_heights.js
That happens only for IE8 ?
Please Log in to join the conversation.
-
somedudefred
Inactive member - Topic Author
- Member
Less
More
- Posts: 36
- Thank you received: 0
10 years 11 months ago #35951
by somedudefred
Replied by somedudefred on topic JavaScript Syntax Error
Hello Ivan.
I did not see that line of code loading in the 'View Page Source'. I have attached an image to show every line of code where 'script' appears in the head tag.
No. This also happens in Chrome and Firefox.
Any suggestions?
Thank you Ivan.
I did not see that line of code loading in the 'View Page Source'. I have attached an image to show every line of code where 'script' appears in the head tag.
No. This also happens in Chrome and Firefox.
Any suggestions?
Thank you Ivan.
Please Log in to join the conversation.
-
ivan.milic
Support Staff - Moderator
Less
More
- Posts: 14116
- Thank you received: 1639
10 years 11 months ago #35960
by ivan.milic
Replied by ivan.milic on topic JavaScript Syntax Error
Can you confirm you have this code in index.php of template:
<!-- equal heights -->
<script type="text/javascript" src="<?php echo $template_path ?>/js/equal_heights.js"></script>
it goes just above code you did modify, maybe you accidentally removed it???
<!-- equal heights -->
<script type="text/javascript" src="<?php echo $template_path ?>/js/equal_heights.js"></script>
it goes just above code you did modify, maybe you accidentally removed it???
Please Log in to join the conversation.
Time to create page: 0.243 seconds