NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
IDE shows javascript error when values filled with php


Joined: 18 May 2007
Posts: 13
Reply with quote
Is there anyway to prevent the IDE from showing an error when there are php tags inside a javascript block. For example

Code:
<script>
  var test = <?= $text; ?>;
</script>


or
Code:

<script>
  var center = [lat: <?= $lat;?>, lng: <?= $lng;?>];
</script>



This shows as a javascript error around the php tags, probably because the ide isn't show a value there, but when the php script is ran, it should be valid.
View user's profileFind all posts by hergy80Send private message


Joined: 08 Dec 2007
Posts: 7
Location: Munich, Germany
Reply with quote
Not sure that this is the correct section to enter this topic, but anyway...
I'll have to second this.

Whenever setting a value of a javascript var (script is part of a php file) from php, PHPed is telling me, that there is an error (unexpected ';' after <?...?>).
While this is just a nuisance, I just now realized, that this error is blocking the concerned variable from being highlighted.
Still not much more than a nuisance, but at least that.
Convenience and productivity features that work erroneous are just half the convenience, aren't they?

Regards
Uwe
View user's profileFind all posts by UweASend private message


Joined: 08 Dec 2007
Posts: 7
Location: Munich, Germany
Reply with quote
While we're at it: the JavaScript parser doesn't seem to know about default parameters:

function fetchHtml(which, param, title= 'Title')

is flagging two errors:

unexpected "=", expecting ")"
unexpected ")"

again, preventing the variable in question to be highlighted.

Am I missing a setting to not flag this as errors?

Regards
Uwe
View user's profileFind all posts by UweASend private message
IDE shows javascript error when values filled with php
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic