Re: 2 Qs re JS scripting

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



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

  • Re: 2 Qs re JS scripting
    ... on injecting your code into the window closing event of the A.HTML window ... a local html file, I will call this A.HTML, A.HTML will be opened as an MDI ... window within the main app. ... to the hosting application. ...
    (microsoft.public.scripting.jscript)
  • Re: 2 Qs re JS scripting
    ... > I have an application that presents it user interface in an MDI OLE'd IE6 ... The app that controls this interface calls ... > opened as an MDI window within the main app. ...
    (microsoft.public.scripting.jscript)
  • Re: MDIChild wanted for good home
    ... If a child form is loaded it automatically ... If no child form is loaded the mdi form will not ... size a window using standard resolution settings ... I have another app that uses MDI. ...
    (microsoft.public.vb.general.discussion)
  • Re: how to properly reparent mdi child from vb6 to vb.net
    ... mdichil of the .Net frame window. ... The problem is that both the original and the newer app are MDI ... > proper child window of the newer frame windows. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MDIChild wanted for good home
    ... making the regular non-MDI form appear as if it was part of the MDI ... app -- i.e. as an MDIChild window. ... If a child form is loaded it automatically ... I have another app that uses MDI. ...
    (microsoft.public.vb.general.discussion)