Is alert(x) not working?

Help with writing and running scripts

Is alert(x) not working?

Postby cawoodm » Thu Jun 21, 2007 8:23 am

Any idea why alert(1) does not work?
cawoodm
Basic User
Basic User
 
Posts: 27
Joined: Mon Mar 27, 2006 12:00 am

Re: Is alert(x) not working?

Postby jorrasdk » Thu Jun 21, 2007 8:37 am

The alert() method is part of the HTML DOM (document object model) of javascript. This is not a part of the javascript core, and thus not available to scripting in UltraEdit.

Instead in UltraEdit 13.10 the messagebox was introduced:

UE13.10 help wrote:messageBox(Msg,Title);

Msg= Message text in quotes ("")
Title: Title text in quotes ("") (optional)

Presents message dialog with "OK" button. Example:
UltraEdit.messageBox("Can't complete process", "Process Abort");
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: Is alert(x) not working?

Postby Jurriaan » Thu Jun 21, 2007 8:39 am

because alert is also en extension to Core Javascript, which happens to work in most browsers, but not in many other js supporting apps.

Core global functions are:

eval
isFinite
isNaN
parseFloat
parseInt

don't forget that in their ever lasting attempts to be top of the browsermarkets, vendors have added many new extensions to javascript, but they are not really part of the language. And of course that is also how javascript was meant to be used. A core set of functionality that can be extended by the hosting application
User avatar
Jurriaan
Basic User
Basic User
 
Posts: 16
Joined: Wed Aug 30, 2006 11:00 pm

Re: Is alert(x) not working?

Postby cawoodm » Thu Jun 21, 2007 9:26 am

jorrasdk wrote:UltraEdit.messageBox("Can't complete process", "Process Abort");


This doesn't work for me. I'm on the latest UEStudio 6.30.
cawoodm
Basic User
Basic User
 
Posts: 27
Joined: Mon Mar 27, 2006 12:00 am

Re: Is alert(x) not working?

Postby Mofi » Thu Jun 21, 2007 3:08 pm

UEStudio v6.30 and UltraEdit v13.10 have the identical scripting engine.

I started my UEStudio v6.30, created a new ASCII DOS file, pasted the line

UltraEdit.messageBox("Can't complete process", "Process Abort");

saved the file as Test.js and clicked in menu Scripting on item Run Active Script and I see the message box with correct title and message text.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Scripts