Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2007, 04:16 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default Urgent:How to call the external function

Hi Pro,
If I used javascript for a web page,then how could I call the external function from the external script to another?Please teach me...

Thank you.

 
Old October 10th, 2007, 07:48 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Can you define your requirements a little more clearly? What pages and scripts do you have and where are the functions you want to call?

--

Joe (Microsoft MVP - XML)
 
Old October 10th, 2007, 11:14 PM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

Sorry about that,but got any differences for that?
Actually I want to use html or asp page to call a external javascript function to do some calculation.Please show me some example for that.Because I do not know where the function should put at the page for call it also.The information is it enough for you?Sorry again I am a newbie for javascript.
Waiting for your advices.

Thank you.

 
Old October 11th, 2007, 05:28 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Ivanlaw!!
yes at some extent you can do this
include the js to ur web page
and call the function
if u r looking something othe than wht i expected plz explain in detail

Cheers :)

vinod
 
Old October 11th, 2007, 07:48 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Still not quite clear on what you want but there are basically two methods for adding client-side script to a page, you write the code in a script block in the page or you write the code in a separate file and use the script block's src attribute to specify the location.
Then you can use any of the functions defined in the script from within a script block on the page. The code is executed on the browser, not on the server, so it will have no direct contact with any of the server-side code.

--

Joe (Microsoft MVP - XML)
 
Old October 12th, 2007, 01:17 AM
Authorized User
 
Join Date: Jun 2007
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ivanlaw Send a message via Yahoo to ivanlaw
Default

Hi vinod_yadav1919,
Could you show some example for your method?Because I very curious for that also.
Actually I used Page A to call a external script which is J.js to calculate something.After that I also used the Page B to call the J.js to verify some data in the script.But the Page B must call the J.js when it onload.Please some me some example for that.Sorry about my english not very good...
Waiting for your advices...

Thank you.

 
Old October 16th, 2007, 12:16 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi IvanLaw!!

hope this will help you.
please let me know if you find any other alternatives
please put url of the js in this code too,i have just tested at our servers(vinod_yadav1919.com is for just to show the demo)
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<script>
function chk()
{
t=1
extCalculate()
//Note extCalculate method is defined in the vinod_yadav1919.com
//if this extCalculate methods return value then assign it to
//retValue=extCalculate()

}
</script>
    
    <script type="text/javascript" src="http://vinod_yadav1919.com/datagrid/ss.js"></script>

<input type=button onclick="chk()" value="checkExtJS">
</BODY>
</HTML>


Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call an External program to run ? itayzoro VB.NET 2002/2003 Basics 0 July 31st, 2008 01:45 AM
call external program from vb.net praswani Pro VB.NET 2002/2003 2 October 18th, 2007 07:19 AM
Call or linking to external .jar file tony_s Java Basics 0 December 16th, 2006 05:20 PM
How to call java external files? hlchuah77 Java GUI 2 September 12th, 2004 02:10 PM
how to call an external program? schockp Oracle 2 November 13th, 2003 07:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.