Source language: Translate to:

BrowserExecScript issue

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

BrowserExecScript issue

Postby dpayer » Thu Dec 28, 2006 9:40 am

I am attempting to use the BrowserExecScript function and the sample from this post http://www.neosoftware.com/forum/viewtopic.php?t=14157&highlight=browserexecscript works properly to re-write the content of a browser.

This works fine with text.

I would like to re-write the entire webpage :) with a variable (or better yet, have NB allow the page to be constituted with the contents of a variable but the only allowed function now is a URL or a file - please consider this for future releases!!!!)

If I create a simple page in HTML and strip out the CRLF s in it, I can use that as the "text" content with no problem. I can even use this when I insert the contents of a string held in a variable. The problem is when HTML elements themselves contain quotes.

Example of html:
Code: Select all
<html><head><meta http-equiv="Content-Language" content="en-us"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>test</title></head><body bgcolor="#FFFFCC"><table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600" id="AutoNumber1">  <tr>    <td width="100" bgcolor="#FFFFFF">abc</td>    <td width="150" bgcolor="#FFFFFF">def</td>    <td width="75" bgcolor="#FFFFFF">GHI</td>  </tr>  <tr>    <td width="100" bgcolor="#FFFFFF">JKL</td>    <td width="150" bgcolor="#FFFFFF">Mno</td>    <td width="75" bgcolor="#C0C0C0">pqr</td>  </tr></table></body></html>


This (if copied and saved to a file) makes a simple page with a yellow background and a table with two rows that have white background, except for one cell.

If I use this 'as is' in the string contained in a variable, it converts all quotes to [#34] and then gives a error on execution:
Could not complete the operation due to error 80020101


If I convert all the quotes to %22 the script will execute but the HTML renders wrong as the cell widths and colors are no longer defined properly for the rendering machine of MSIE.

Code: Select all
<html><head><meta http-equiv=%22Content-Language%22 content=%22en-us%22><meta http-equiv=%22Content-Type%22 content=%22text/html; charset=windows-1252%22><title>test</title></head><body bgcolor=%22#FFFFCC%22><table border=%221%22 cellpadding=%220%22 cellspacing=%220%22 style=%22border-collapse: collapse%22 bordercolor=%22#111111%22 width=%22600%22 id=%22AutoNumber1%22>  <tr>    <td width=%22100%22 bgcolor=%22#FFFFFF%22>abc</td>    <td width=%22150%22 bgcolor=%22#FFFFFF%22>def</td>    <td width=%2275%22 bgcolor=%22#FFFFFF%22>GHI</td>  </tr>  <tr>    <td width=%22100%22 bgcolor=%22#FFFFFF%22>JKL</td>    <td width=%22150%22 bgcolor=%22#FFFFFF%22>Mno</td>    <td width=%2275%22 bgcolor=%22#C0C0C0%22>pqr</td>  </tr></table></body></html>


I suppose I could have a javascript rewrite the entire body apart from NB from files that NB could write to disk but it seems a waste of computing power/time.

Is it possible to insert directly into the browser the contents of a string contained in a variable?

Is is posible to work around the requirements of converting quotes to %22 somehow? I would appreciate any suggestions.

David P.
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Thu Dec 28, 2006 9:58 am

David P:
I would like to re-write the entire webpage with a variable (or better yet, have NB allow the page to be constituted with the contents of a variable but the only allowed function now is a URL or a file - please consider this for future releases!!!!)

Is it possible to insert directly into the browser the contents of a string contained in a variable?
... ask and you shall receive ... or should I say, you shall receive BEFORE you ask :-) ... take a look at BrowserLoadFromStr command ... from before v5.5
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Thu Dec 28, 2006 10:18 am

Gaev wrote:David P:
I would like to re-write the entire webpage with a variable (or better yet, have NB allow the page to be constituted with the contents of a variable but the only allowed function now is a URL or a file - please consider this for future releases!!!!)

Is it possible to insert directly into the browser the contents of a string contained in a variable?
... ask and you shall receive ... or should I say, you shall receive BEFORE you ask :-) ... take a look at BrowserLoadFromStr command ... from before v5.5


Gee.. :oops:

I thought it was possible but was looking in the wrong place.

Thanks Gaev. BTW, do you quote the NB manual from memory or something like that? (hmm or has dreams of NB programs he creates from memory . .. . . )
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Thu Dec 28, 2006 2:09 pm

David P:
BTW, do you quote the NB manual from memory or something like that? (hmm or has dreams of NB programs he creates from memory
... No, my (limited0 memory capacity is too important to stuff with details ... instead, I fill it with links to the detailed stuff ... e.g. my IE Favorites has about 200+ (organized) entries.

As far as NeoBook is concerned, I have a shortcut to the Help file setup on Windows Desktop ... and I start it every time before I start NeoBook ... or when I need to lookup something in response to a post.

But the BrowserLoadfromStr command holds a special place in my memory ... when Dave added Browser related commands in v5.0 ... I suggested this variation during Beta Testing ... and Dave kindly included it before the final release ... its value has increased even more since the additional Browser related functions were added in v5.5.
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests

cron