FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

NetBeans PHP, unexpected error with javascript live parsing

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
mikestp



Joined: 09 Mar 2009
Posts: 4

PostPosted: Mon Mar 09, 2009 1:20 pm    Post subject: NetBeans PHP, unexpected error with javascript live parsing Reply with quote

Hi,
I'm using NetBeans PHP and it is simply amazing! Have used othe PHP editors but this one is the best!
However, I have some javascript code and NetBeans Liver Parser returns the error "unterminated regular expression" for the line with cookieEnable. Any clue?

Thanks.

<script language="JavaScript" type="text/javascript">
function ChangeLanguage(warning) {
if(!(navigator.cookieEnabled)) {
alert(warning); } }
</script>
Back to top
View user's profile Send private message
Filip Zamboj
Posted via mailing list.





PostPosted: Tue Mar 10, 2009 8:00 pm    Post subject: NetBeans PHP, unexpected error with javascript live parsing Reply with quote

Honestly not Smile. Could you send me part of your code? I'll have a look
and find a solution, hopefully.

Regards,

Issuezilla HowTo: http://www.netbeans.org/community/issues.html
-------------
Filip Zamboj
Sun Microsystems



mikestp wrote:
Quote:
Hi,

I'm using NetBeans PHP and it is simply amazing! Have used othe PHP editors but this one is the best!

However, I have some javascript code and NetBeans Liver Parser returns the error "unterminated regular expression" for the line with cookieEnable. Any clue?



Thanks.



<script language="JavaScript" type="text/javascript">

function ChangeLanguage(warning) {

if(!(navigator.cookieEnabled)) {

alert(warning); } }

</script>










Back to top
mikestp



Joined: 09 Mar 2009
Posts: 4

PostPosted: Tue Mar 10, 2009 8:19 pm    Post subject: unterminated regular expression Reply with quote

The code is all there already. Just copy/paste this in a new .js file and you get 3 errors, 2 syntax errors and 1 "unterminated regular expression" error. The code works fine on all 3 major browsers. Doesn't even report any errors in Firebug or any other js debugger. But NetBeans 6.5 Editor, highlights the code with the 3 errors mentioned above. Thank you for helping. It's just annoying to have these 3 errors always listed at the top of the Tasks window.

<script language="JavaScript" type="text/javascript">
function ChangeLanguage(warning) {
if(!(navigator.cookieEnabled)) {
alert(warning); } }
</script>
Back to top
View user's profile Send private message
Eugene Morgan
Posted via mailing list.





PostPosted: Wed Mar 11, 2009 2:14 pm    Post subject: NetBeans PHP, unexpected error with javascript live parsing Reply with quote

Get rid of the <script> tags

On Tue, Mar 10, 2009 at 3:19 PM, mikestp <address-removed ([email]address-removed[/email])> wrote:
Quote:
The code is all there already.
Back to top
mikestp



Joined: 09 Mar 2009
Posts: 4

PostPosted: Wed Mar 11, 2009 5:07 pm    Post subject: Reply with quote

Okay thanks, it works but my ego was hurt.
Not sure if I want to risk it again... don't want my ego to be hurt again... But... I am now getting a warning from the live parser that this piece of code (in a js file) is not supported by all targetted browsers; but it actually works fine since everything is in try blocks:

function getHTTPObject()
{
try { return new XMLHttpRequest(); } catch(e) {}
try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {}
try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {}
return null;
}

Thanks!
Back to top
View user's profile Send private message
Eugene Morgan
Posted via mailing list.





PostPosted: Wed Mar 11, 2009 5:55 pm    Post subject: NetBeans PHP, unexpected error with javascript live parsing Reply with quote

On that one, I think you can get rid of the warning if you click on the little yellow icon to the left and choose "Don't report usages of XMLHttpRequest". I haven't tried it though - I don't know if it will save your preference for other files ...

On Wed, Mar 11, 2009 at 12:07 PM, mikestp <address-removed ([email]address-removed[/email])> wrote:
Quote:
Okay thanks, it works but my ego was hurt.

Not sure if I want to risk it again... don't want my ego to be hurt again... But... I am now getting a warning from the live parser that this piece of code (in a js file) is not supported by all targetted browsers; but it actually works fine since everything is in try blocks:



function getHTTPObject()

{

Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB