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
Share on other sites

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.