Jump to content

[SOLVED] JavaScript Line Numbers


SoberDude

Recommended Posts

Everytime an error occurs on my website, it displays the line number which it occurred on.

 

However, using PHP, I include files, some of which have JavaScript in them. Look here:

 

<?php

include("file_with_javascript.php");

//php code here

?>

<script type='text/javascript'>

//javascript code here

</script>

<?php

//more php code here

?>

 

If the file "file_with_javascript.php" has 15 lines of JavaScript in it, and an error occurs on the code above (let's say line 11; including all the PHP code), it will say that the error occurred, for example, on line 17 or something similar. Meaning, unlike PHP errors, it doesn't tell you the actual line in the file that the error occurred on.

 

Any way around this?

Link to comment
https://forums.phpfreaks.com/topic/162825-solved-javascript-line-numbers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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