Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-11
2
Medium Priority
?
253 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
dxdinh earned 1000 total points
ID: 34876203
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
ID: 34876364
I guess that's the only way then.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

618 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