Source language: Translate to:

Two browser Questions !!

Questions and information about creating Internet aware NeoBook applications. Including PHP, HTML, FTP, HTTP, Email, etc.

Moderator: Neosoft Support

Postby Gaev » Fri Apr 08, 2011 7:32 am

Tony Kroos:
Yes, it is not a 'string', but anyway I was hoping to reconstruct it manually )) And also it seems to be a reason why [#124] doesnt work.

Did some research (fancy word for Google Search) ... and here is a response to a similar problem encountered by another user of this forum ... http://stackoverflow.com/questions/4940 ... javascript ...
Code: Select all
var re = new RegExp("regex","g");
"mystring".replace(re, "newstring");
... now you can supply a string/text value in the first command line ... in place of "regex".

I haven't tried it ... let us know how it turned out.
User avatar
Gaev
 
Posts: 3737
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Tony Kroos » Fri Apr 08, 2011 11:13 am

You are my king! :D

Code: Select all
alert ('hello, script is running');
var str="This is not working";
param='i'+String.fromCharCode(124)+'o';
var reg = new RegExp(param,"g");
var result=str.replace(reg, "REPLACED");
alert(result);


But, there are some other cases where "|" is used. I will try to fight them too ) Thanks!
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Postby Tony Kroos » Tue Jul 05, 2011 7:58 am

still I do not understand why this works:
Code: Select all
BrowserLoadFromStr "WebBrowser1" "[#91][#93][#34]etc..."

and this is not:
Code: Select all
BrowserLoadFromStr "WebBrowser1" "[#124]"

where is that stick? )
Also it causes problems with BrowserExecScript as discussed above...
is this some kind of bug or something? maybe it should be fixed?
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Postby Neosoft Support » Tue Jul 05, 2011 11:23 am

NeoBook is interpreting the pipe symbol "|" as a carriage return.

You can work around this using the BrowserExecScript action like this:

Code: Select all
SetVar "[HTML]" "![#124]"

BrowserExecScript "WebBrowser1" "atext=window.external.nbGetVar( 'HTML' );|document.write(atext);" "JScript"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Tony Kroos » Tue Jul 05, 2011 9:52 pm

also you may just use html charcode - | ;
For javascript I would like to use | as native nb "special char" without workarounds which are often incompatible with the js syntax. Maybe there is a chance to disable | interpretation for browserexecscript at all?
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Postby Neosoft Support » Wed Oct 19, 2011 11:02 am

For javascript I would like to use | as native nb "special char" without workarounds which are often incompatible with the js syntax. Maybe there is a chance to disable | interpretation for browserexecscript at all?


We would have to turn it off for everything because all action parameters are processed through a single filter. I suppose we could have an action to temporarily disable/enable interpretation of the pipe character. For example:

DisablePipeCharacter
BrowserLoadFromStr "WebBrowser1" "|"
EnablePipeCharacter

We can think about it.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Previous

Return to NeoBook and the Internet

Who is online

Users browsing this forum: No registered users and 1 guest