Solved

javascript, how to insert the javascript content from a javascript file into the html

Posted on 2011-02-11
2
244 Views
Last Modified: 2012-08-14
So instead of referencing a javascript file:
<html>
<head>
<script language="javascript" type="text/javascript" src="/javascript/my_utils.js">
</script>

I would like the content of that javascript file inserted into the HTML.  Is there a way to do that?
0
Comment
Question by:rgbcof
2 Comments
 
LVL 7

Accepted Solution

by:
dxdinh earned 250 total points
Comment Utility
just paste the content of my_utils.js  inside script tag and remove the source


// something like this
<script language="javascript" type="text/javascript" >

var globalX = "xx";
function x ()
{

}

function y()
{
}

.....



</script>
0
 

Author Closing Comment

by:rgbcof
Comment Utility
I guess that's the only way then.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now