Re: 2 Qs re JS scripting

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



So basically, the application launches A.JS, which pops up A.HTML as UI for
user to interact with, and when A.HTML is closed, the selected parameters
need to be retrieved by A.JS.

You do not (and cannot) watch for A.HTML to close, so you will have to rely
on injecting your code into the window closing event of the A.HTML window
that is popped up.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Adrian" <Adrian@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:ddn22g$p2h$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have an application that presents it user interface in an MDI OLE'd IE6
browser window. The app that controls this interface calls .js files for
given events. Thus on event A it would call A.JS from its directory.

What I want to do is take parameters that are available to the A.JS and open
a local html file, I will call this A.HTML, A.HTML will be opened as an MDI
window within the main app.

I want to take the parameters that are in available to A.JS open the A.HTML
(I can now do the open bit as the main app has an API call to open an html
file as an MDI window) perform some tasks around the parameters based on
what the user clicks on in the displayed A.HTML page, after they have
clicked on X I will do some stuff and then the page should close returning
to the hosting application. but before the hosting application takes back
control i.e. when A.JS ends I need to make another call to the hosting
application. thus I wanted to watch A.HTML and pause A.JS until A.HTML is
closed.

All of this local, no webserver local or remote all of this is just flat
files!

Thanks for everyone's help and input thus far.

I Hope I have made it clearer!




"David Wang [Msft]" <someone@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:OwksLRJoFHA.420@xxxxxxxxxxxxxxxxxxxxxxx
> Can you please rephrase your questions, perhaps by describing what you are
> trying to do... because I have no idea what you are trying to ask. Opening
> an HTML from JS and passing querystring data to the HTML (or JS?) makes
> very
> little sense.
>
> NTFS supports file change notification which would give you the
> asynchronous
> callback as soon as the monitored file is closed, but scripting does not
> expose it. So, you cannot do this the easy, async way. You may be able to
> synchronously loop and keep trying to access the file and use error
> condition to determine if a file is closed, but that is really bad code.
>
> Why do you need to know when the file is closed, and what are you trying
> to
> do with the JS and HTML files?
>
> --
> //David
> IIS
> http://blogs.msdn.com/David.Wang
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> //
> "Adrian" <Adrian@xxxxxxxxxxxxxxxxxxxx> wrote in message
> news:ddkopj$r9p$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi
> Thanks for your help, sorry for posing it twice but I didn't see the
> original show +24 from posting and I still cannot see it!! but it must be
> there as you have kindly replied to it!
>
> I will try the query string bits later. Any help on opening an HTML from a
> JS and more importantly knowing when it closes or is closed?
>
> thanks
>
> "Trevor L." <tandcl@xxxxxxxxxxxxxxx> wrote in message
> news:%23Xn2EC7nFHA.4028@xxxxxxxxxxxxxxxxxxxxxxx
>> And here is the function I use to obtain the Xth parameter, where X =
>> parm
>> + 1
>> i.e. qsobj(0) obtains parameter 1, qsobj(1) obtains parameter 2
>>
>> function qsobj(parm)
>> {
>> var qstring = document.location.search.substring(1)
>> var qpairs = qstring.split("&")
>> var qvbl = qpairs[parm].split("=")
>> return unescape(qvbl[1].replace("%20"," ").replace("+"," "))
>> }
>> I found this on the web somewhere and refined it a little. If any one can
>> make it more succinct, would be grateful
>>
>> The replace of %20 and + may not be necessary in all cases. I understood
>> that some browsers use + in place of blanks
>> --
>> Cheers,
>> Trevor L.
>> Website: http://tandcl.homemail.com.au
>>
>> Randy Webb wrote:
>>> Bob Barrows [MVP] said the following on 8/12/2005 6:02 PM:
>>>> Adrian wrote:
>>>>
>>>>> 1. I have an HTML file on a local harddisk and I want to open it
>>>>> from another local .js file passing it a string for it to read and
>>>>> display e.g. test.html?this_is/atest so how do I do all of that?!
>>>>>
>>>>> 2. from the JS file that called the above I want to know when
>>>>> test.html has closed or been closed?
>>>>>
>>>>> Is this all possible and if so how?
>>>>>
>>>>> OS XP Pro Sp2
>>>>>
>>>>> I did post this in another group but it was suggested this may be a
>>>>> better forum to ask it in!
>>>>
>>>>
>>>> You need ASP in order to use a querystring, which means you need a
>>>> web server. You cannot use a querystring in a .htm file, especially
>>>> one opened from a hard drive without using a web server.
>>>
>>> Excuse me? JScript is very well capable of handling a queryString.
>>>
>>> var myLoc = document.location.href;
>>> var queryString = myLoc.split('?');
>>> if (queryString[1]){alert(queryString[1])}
>>> else{alert('NO Query String present')}
>>>
>>> Why do you need a web server?
>>>
>>> And that is not even the easiest/best way to get the queryString.
>>>
>>>> I'm not sure why you were told to come here, unless it was felt that
>>>> you could pass arguments to a window opened with window.open instead
>>>> of using a querystring ...
>>>
>>> You can do either and both, even at the same time.
>>>
>>>
>>> --
>>> Randy
>>> comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
>>
>>
>
>
>



.



Relevant Pages

  • [kde] Re: Desktop effects with intel 945
    ... plain text only, but last time I did not consciously send the HTML ... window translucency can be useful at times as ... However, if you want, you /can/ actually switch to compiz for KDE's window ...
    (KDE)
  • [kde] Re: KDE 4.6.0 and nvidia drivers
    ... Please don't post in HTML to the mailing lists. ... the nv driver is deprecated. ... But I refused to turn off effects like window translucency ... general tab under Desktop Effects and defaults to "normal". ...
    (KDE)
  • Re: 2 Qs re JS scripting
    ... I have an application that presents it user interface in an MDI OLE'd IE6 ... a local html file, I will call this A.HTML, A.HTML will be opened as an MDI ... window within the main app. ...
    (microsoft.public.scripting.jscript)
  • Re: Q.: Only one font in use, but 100 fonts embedded ... ?
    ... One should note that not all of the 'WYSIWYG' systems for LaTeX are ... Using LaTeX is like writing HTML -- you do your editing in ... or your LaTeX programming; in another window -- a ...
    (comp.text.pdf)
  • Re: CHTMLView and window.close
    ... > I am using CHTMLView in my app. ... When an html page contains script ... > close the window manually. ... WebBrowser Control Disappears When Script ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)