| View previous topic :: View next topic |
| Author |
Message |
mikestp
Joined: 09 Mar 2009 Posts: 4
|
Posted: Mon Mar 09, 2009 1:20 pm Post subject: NetBeans PHP, unexpected error with javascript live parsing |
|
|
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 |
|
 |
Filip Zamboj Posted via mailing list.
|
Posted: Tue Mar 10, 2009 8:00 pm Post subject: NetBeans PHP, unexpected error with javascript live parsing |
|
|
Honestly not . 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
|
Posted: Tue Mar 10, 2009 8:19 pm Post subject: unterminated regular expression |
|
|
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 |
|
 |
Eugene Morgan Posted via mailing list.
|
Posted: Wed Mar 11, 2009 2:14 pm Post subject: NetBeans PHP, unexpected error with javascript live parsing |
|
|
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
|
Posted: Wed Mar 11, 2009 5:07 pm Post subject: |
|
|
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 |
|
 |
Eugene Morgan Posted via mailing list.
|
Posted: Wed Mar 11, 2009 5:55 pm Post subject: NetBeans PHP, unexpected error with javascript live parsing |
|
|
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 |
|
 |
|
|
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
|
|
|
|
|
|