Jump to content

load script tag

- - - - -

  • Please log in to reply
1 reply to this topic

#1
jaylea

jaylea

    Newbie

  • Members
  • Pip
  • 1 posts
Hello,

I have this issue where I have this file with content like this in it:

This is a php file with js & php inside.
<script type="text/javascript" src="<?php echo PATH_JAVASCRIPT; ?>warning_boxes.js"></script>

<script type="text/javascript">

// Some content is here. to long to paste.

</script>


I need to get this file loaded into the html of the page when a link is clicked. At the moment when you click a link it loads a content file into:

<div id="content"></div>

I would like for the javascript file above to be loaded into the content and function as the content that is loaded needs to use the javascript is the js file.

Any thought would be great. Also the site is using jQuery so would be great if this can be done with jQuery.

Thanks everyone.
J

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
I think that's this you want: jQuery.getScript() – jQuery API




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users