Can Javascript call up a Javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davewright
    New Member
    • Jan 2007
    • 5

    Can Javascript call up a Javascript

    I am very very new to javscript so here go's. I am given a Javascritpt link to put ads on my web site and as the ad server servers the ads they display on my site. I also pass the ads to some of my other friends web sites but I dont want them to know where the ads are coming from (my ad agency) so can I create some javascript that will calls up the javascript my agency gave me? then create another javescript that will call up that javascript and give that to my friends this way they only see my javascript not my agencys or any link refering to my agencys..
    I hope this makes sence
    Regards
    Dave
    thanks for any help in advance
  • Samji
    New Member
    • Dec 2006
    • 23

    #2
    It sounds like your trying to do something which
    involves Cross-site scripting (XSS). It is best to avoid this due to security issues.

    It would probably be better for you to use the script from your ad agency which you can store on the same server as your site and then just reference it in your pages as:

    [html]
    <script language="Javas cript"
    type="text/javascript" src="scriptname .js"/>
    [/html]

    If you don't want people to see your ads' source, you're probably best off serving them with a server side technology such as PHP or ASP where source code can be hidden from the visitor.

    Comment

    • davewright
      New Member
      • Jan 2007
      • 5

      #3
      Hi Thanks for your help. let me see if I understand this one of the main points is I need to give my mates a javascript code because I was just embedding the code on a page and creating a Iframe and passing the Iframe to them but sometimes the ads are expandables so a iframe wont do.

      so here is a sample code from the agency

      <script language="JavaS cript" type="text/javascript" src="http://view.atdmt.com/UMC/jview/gcpmdxbx0400000 043umc/direct/01?click=">
      </script><noscrip t><a href="http://clk.atdmt.com/UMC/go/gcpmdxbx0400000 043umc/direct/01/" target="_blank" ><img border="0" src="http://view.atdmt.com/UMC/view/gcpmdxbx0400000 043umc/direct/01/" /></a></noscript>


      can I copy this in to a .js page ? or do I need to alter the tages?

      I tried placeing this code on a page call test.js I placed it in my root of my server and then useed your example to call up the code from a another page

      <body>
      <div id="Layer1"><sc ript language="Javas cript"
      type="text/javascript" src="my url /test.js"/></div>
      </body>
      </html>

      but it did not work. any Ideas?
      Regards
      Dave

      Originally posted by Samji
      It sounds like your trying to do something which
      involves Cross-site scripting (XSS). It is best to avoid this due to security issues.

      It would probably be better for you to use the script from your ad agency which you can store on the same server as your site and then just reference it in your pages as:

      [html]
      <script language="Javas cript"
      type="text/javascript" src="scriptname .js"/>
      [/html]

      If you don't want people to see your ads' source, you're probably best off serving them with a server side technology such as PHP or ASP where source code can be hidden from the visitor.

      Comment

      • iam_clint
        Recognized Expert Top Contributor
        • Jul 2006
        • 1207

        #4
        Code:
        <script language="JavaScript" type="text/javascript" src="http://view.atdmt.com/UMC/jview/gcpmdxbx0400000043umc/direct/01?click=">
        </script><noscript><a href="http://clk.atdmt.com/UMC/go/gcpmdxbx0400000043umc/direct/01/" target="_blank"><img border="0" src="http://view.atdmt.com/UMC/view/gcpmdxbx0400000043umc/direct/01/" /></a></noscript>
        this is includes putting includes inside of an include i'm not so sure that will work..

        just give them this code and it should work.

        Comment

        • davewright
          New Member
          • Jan 2007
          • 5

          #5
          Hi thanks for the reply but what I am trying to do is hide the code from the agency and give my friends some code that calls up the agency code thats why I wanted to know if I could call up another Javascript.
          Cheers
          Dave




          Originally posted by iam_clint
          Code:
          <script language="JavaScript" type="text/javascript" src="http://view.atdmt.com/UMC/jview/gcpmdxbx0400000043umc/direct/01?click=">
          </script><noscript><a href="http://clk.atdmt.com/UMC/go/gcpmdxbx0400000043umc/direct/01/" target="_blank"><img border="0" src="http://view.atdmt.com/UMC/view/gcpmdxbx0400000043umc/direct/01/" /></a></noscript>
          this is includes putting includes inside of an include i'm not so sure that will work..

          just give them this code and it should work.

          Comment

          • iam_clint
            Recognized Expert Top Contributor
            • Jul 2006
            • 1207

            #6
            You might search google for encrypting javascript.

            Comment

            • davewright
              New Member
              • Jan 2007
              • 5

              #7
              Thanks for your help I will try that
              Cheers
              Dave



              Originally posted by iam_clint
              You might search google for encrypting javascript.

              Comment

              • Samji
                New Member
                • Dec 2006
                • 23

                #8
                Originally posted by davewright
                Hi Thanks for your help. let me see if I understand this one of the main points is I need to give my mates a javascript code because I was just embedding the code on a page and creating a Iframe and passing the Iframe to them but sometimes the ads are expandables so a iframe wont do.

                so here is a sample code from the agency

                <script language="JavaS cript" type="text/javascript" src="http://view.atdmt.com/UMC/jview/gcpmdxbx0400000 043umc/direct/01?click=">
                </script><noscrip t><a href="http://clk.atdmt.com/UMC/go/gcpmdxbx0400000 043umc/direct/01/" target="_blank" ><img border="0" src="http://view.atdmt.com/UMC/view/gcpmdxbx0400000 043umc/direct/01/" /></a></noscript>


                can I copy this in to a .js page ? or do I need to alter the tages?

                I tried placeing this code on a page call test.js I placed it in my root of my server and then useed your example to call up the code from a another page

                <body>
                <div id="Layer1"><sc ript language="Javas cript"
                type="text/javascript" src="my url /test.js"/></div>
                </body>
                </html>

                but it did not work. any Ideas?
                Regards
                Dave
                You can't paste that into a JS file because its HTML.
                You need to create a script that loads ads on your web page and then reference to the script. If you PM me your email address, I'll send you something I made a while back, which you can easily adapt to suit your purpose.

                Comment

                Working...