Results 1 to 3 of 3

Thread: import javascript

  1. #1
    Join Date
    Sep 2005
    Location
    KL
    Posts
    5
    Rep Power
    0

    import javascript

    hi
    mcm mana coding untuk import/include file code javascript dalam satu lagi fail html

    contohnya klu utk fail asp ..code dia mcm ni kan....
    <!--#include file="abc.asp"-->

    javascript lak mcm mana?

  2. #2
    Join Date
    Aug 2001
    Location
    KL
    Posts
    8
    Rep Power
    0
    Quote Originally Posted by honeyz
    hi
    mcm mana coding untuk import/include file code javascript dalam satu lagi fail html

    contohnya klu utk fail asp ..code dia mcm ni kan....
    <!--#include file="abc.asp"-->

    javascript lak mcm mana?
    hi,
    nie cth camner nak include file dari google adsense.
    harap ianya membantu.

    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

  3. #3
    Join Date
    Apr 2019
    Location
    Ahmedabad
    Posts
    31
    Rep Power
    0
    While Importing an external Javascript file we need to keep two things in mind.
    (1) The file you are importing must be valid JavaScript, and only JavaScript.
    (2) The file must have the file extension ".js". Even one must know the location of the file.

    Here,a file "myjs.js" contains a alert function. Also, the file is in the same directory as the HTML file.

    myjs.js :

    Code:
    function popup() {
    alert("Hello World")
    }
    myhtml.html:
    Code:
    <html>
    <head>
    <script src="myjs.js">
    </script>
    </head>
    <body>
    <input type="button" onclick="popup()" value="Click Me!">
    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. javascript + php
    By niurexx in forum Website Programming
    Replies: 0
    Last Post: 08-12-2008, 08:52 AM
  2. Replies: 1
    Last Post: 20-04-2008, 04:09 PM
  3. problem import data drpd ms excel ke MySQL
    By mys_az in forum Website Programming
    Replies: 6
    Last Post: 20-09-2007, 11:54 AM
  4. javascript + php
    By tenuk in forum Website Programming
    Replies: 3
    Last Post: 11-12-2006, 09:32 AM
  5. javascript question
    By kelly001 in forum Website Design
    Replies: 0
    Last Post: 22-07-2003, 01:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32