473,698 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoke JS function from extenal application

Does anyone know if it is possible to invoke a Javascript function in a web
page from an external application? I've got some data that I want to pass
from a windows application to a web page without refreshing the page (thus
the javascript function).

Any other possible methodologies that anyone could suggest?

Has anyone done anything like this?
Nov 16 '05 #1
4 2246
You can do this. But need more information about this issue.

Regards
Vadivel Kumar

"SteveS" <St****@discuss ions.microsoft. com> wrote in message
news:2A******** *************** ***********@mic rosoft.com...
Does anyone know if it is possible to invoke a Javascript function in a web page from an external application? I've got some data that I want to pass
from a windows application to a web page without refreshing the page (thus
the javascript function).

Any other possible methodologies that anyone could suggest?

Has anyone done anything like this?

Nov 16 '05 #2
If you are hosting the Web Browser ActiveX control in your page, then yes,
I'm pretty sure you can. But if you mean have a Windows app gain access to
a normal browser window? Well that's beyond my skills, but I suppose it's
possible, and probably not highly recommended. A plug-in for IE might do
it.

--
C#, .NET and Complex Adaptive Systems:
http://blogs.geekdojo.net/Richard
"SteveS" <St****@discuss ions.microsoft. com> wrote in message
news:2A******** *************** ***********@mic rosoft.com...
Does anyone know if it is possible to invoke a Javascript function in a
web
page from an external application? I've got some data that I want to pass
from a windows application to a web page without refreshing the page (thus
the javascript function).

Any other possible methodologies that anyone could suggest?

Has anyone done anything like this?

Nov 16 '05 #3
What would you like to know? Maybe an example will help:

Let's say we have a web page with a javascript function called "Hello(name )"
The function takes the variable "name" and pops the value up in an alert box.

Then in a windows app, I have a form with a textbox and a button.

I want to be able to enter a value into the textbox located on the form and
when I press the button, have the value passed directly into the javascript
function located in the web page.

Couple of caveats:

1) This is a standalone instance of a browser - not a browser embedded in
another app
2) I would like to invoke the javascript directly (i.e. No page refresh due
to GET/POST)

Am I dreaming? Can this be done?

"Vadivel Kumar" wrote:
You can do this. But need more information about this issue.

Regards
Vadivel Kumar

"SteveS" <St****@discuss ions.microsoft. com> wrote in message
news:2A******** *************** ***********@mic rosoft.com...
Does anyone know if it is possible to invoke a Javascript function in a

web
page from an external application? I've got some data that I want to pass
from a windows application to a web page without refreshing the page (thus
the javascript function).

Any other possible methodologies that anyone could suggest?

Has anyone done anything like this?


Nov 16 '05 #4
Steve,

It's possible. The first thing you have to do is find the running
instance of internet explorer (I don't know how you would do it for other
browsers). Knowledge base article 176792 titled "How To Connect to a
Running Instance of Internet Explorer" tells you how to do this. You can
find it here (watch for line wrap):

http://support.microsoft.com/kb/176792/EN-US/

The example is for VB6, but it's easy enough to convert it to .NET.

Once you have that, you have access to the browser, and the object model
of the document in the browser. Finding your javascript code an executing
it (through the document object model) is a breeze after that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"SteveS" <St****@discuss ions.microsoft. com> wrote in message
news:AD******** *************** ***********@mic rosoft.com...
What would you like to know? Maybe an example will help:

Let's say we have a web page with a javascript function called
"Hello(name )"
The function takes the variable "name" and pops the value up in an alert
box.

Then in a windows app, I have a form with a textbox and a button.

I want to be able to enter a value into the textbox located on the form
and
when I press the button, have the value passed directly into the
javascript
function located in the web page.

Couple of caveats:

1) This is a standalone instance of a browser - not a browser embedded in
another app
2) I would like to invoke the javascript directly (i.e. No page refresh
due
to GET/POST)

Am I dreaming? Can this be done?

"Vadivel Kumar" wrote:
You can do this. But need more information about this issue.

Regards
Vadivel Kumar

"SteveS" <St****@discuss ions.microsoft. com> wrote in message
news:2A******** *************** ***********@mic rosoft.com...
> Does anyone know if it is possible to invoke a Javascript function in a

web
> page from an external application? I've got some data that I want to
> pass
> from a windows application to a web page without refreshing the page
> (thus
> the javascript function).
>
> Any other possible methodologies that anyone could suggest?
>
> Has anyone done anything like this?


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3655
by: MALdito | last post by:
hi everybody let me say right from the start .. I´m not a coder ... "just" a designer! that said .. here is my question: I´m using dreamweaver´s built in preloader for a menu. it looks like this: function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
2
1887
by: Neil Fedin via .NET 247 | last post by:
I am writing a testing application that uses reflection to open assemblies and call methods. I have a function that looks like this... public void Method1 (int IDArray, bool SomethingElse){ ... } When I prepare the parameters for the above function, I create and integer array and give it some values
1
430
by: S Shulman | last post by:
Hi I am looking for a method that allows calling a method that will be executed by the main application thread bu will be called from any thread that I create manually. (I think that technically it is similar to sending a message to the program) I tried the Invoke method but it seem to work from the calling thread
1
4858
by: boxim | last post by:
hi all, I'm having a few problems whereby my application is hanging when using the Invoke method of a form's control. Basically, when a user clicks a button on the form, it calls a remote function, which in turn fires an event that is caught by the form. The form then need to add a value passed in the event to a form object, however, when using the Invoke method, it just hangs.
4
3574
by: Charles Law | last post by:
Hi guys. I have two threads: a main thread and a background thread. Lots of stuff happens in the background thread that means I have to update several (lots) of controls on a form. It is quite tiresome to have to write code to call MyControl.Invoke for each control on the form, along with the delegates that are required for each. Is there a better way to do this? What I mean is, if I could marshal the
1
1980
by: Lore Leunoeg | last post by:
If I call a delegates BeginInvoke a new thread from the threadpool is started. But what happens if I call the Invoke method? Does this also start a new thread? Thank you sincerely Lore
15
62074
by: Oleg Subachev | last post by:
I need to programmatically invoke from other class Click event of the Button on my Form. Button.OnClick method is protected, not public. How to perform this ? Oleg Subachev
11
11240
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register the onclick attribute of the second button to the javascript to close the form after user clicks upload button click upload do the update to database then programmatically click the second button the use on onclick attribute that sees the...
5
7640
by: Richard | last post by:
Hello, I'm working on an application to allow our network team to use a small application to make DHCP reservations on our Microsoft DHCP Server. The problem is you have to use P/Invoke to do it, and from what I've found on the web and in this newsgroup is that it's not easy, however I believe it can/has been done. At the moment I'm just trying to find out information about an existing
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.