js file inside js file and syntax error

I have include this .js file inside another .js file like this....

document.write('<scr'+'ipt type="text/javascript" src="scripts/rollover.js" ></scr'+'ipt>');

And I am getting an error from this line and can't see where...

    document.write("<td background=images/myImg.jpg'><a href='mailto:webmaster@isp.com' target='_blank' onMouseOver='MM_swapImage('CO e-mail','',images/eImg.jpg',1)' onMouseOut='MM_swapImgRestore()'><img src=images/emailButton.jpg' alt=' CO e-mail' name='CO e-mail' width='157' height='50' border='0'></a></td>");

The functions MM_swapImage and MM_swapImgRestore are in the .js file noted above that was included.

Anyone see the problem?

Thanks,

Zath

 

0
Zath
2/9/2006 3:51:14 PM
asp.net.client-side 24353 articles. 1 followers. Follow

2 Replies
676 Views

Similar Articles

[PageSpeed] 58

document.write("<td background='images/myImg.jpg'><a href='mailto:webmaster@isp.com' target='_blank' onMouseOver=\"MM_swapImage('CO e-mail','',images/eImg.jpg',1)\" onMouseOut=\"MM_swapImgRestore()\"><img src='images/emailButton.jpg' alt=' CO e-mail' name='CO e-mail' width='157' height='50' border='0'></a></td>");
 
that should do the trick, check the quotes around the image ref

Do or Do NOT There is no try{}
0
Andrew
2/9/2006 4:30:17 PM

Thanks!

Not too familiar with certian rules for JavaScript yet and what it was is replacing certin ' with \" when it was referring to a function.

Zath

0
Zath
2/9/2006 5:35:33 PM
Reply:

Similar Artilces:

Include a .JS file into a .JS file
Hi,   Its very simple as below.   For example, Requirement is to add reference in File1.js to File2.js.   document.write("<script type='text/javascript' src='../JS/File2.js'></script>");  All you need to take care is, the source path must be relative to the Page, rather than to the File1.js    Thanks & Regards, Arun Manglick || Senior Tech Lead || http://arun-ts.blogspot.com/  Arun Manglick  Can it not be done like this :include('myFile1.js');  inclu...

how to call js-file from js-file
Hello, I have wrote a FF-extension. The extension consists of a dialog. In the dialog file 'dlg.xul' I import a js-file with '<script type="text/javascript" src="chrome://helloworld/content/ Menue.js"/>' I can now call functions form 'Menue.js' out of the 'dlg.xul' (excellent). Now I want to import the js-file 'Tools.js' in the js-file 'Menue.js'. So I write '<script type="text/javascript" src="chrome://helloworld/ content/Tools.js"/>' at the beginning of the file 'Me...

Importing a .js file into a .js file
I have a javascript file that tries to call a function in another javascript file and it doesn't seem to be working.  Is there an 'import' or 'include' statement that I need to have.  The reason I'm not just putting the function in the file is that I want it to be available to a bunch of different javascript files. Thanks just call the function in the external javascript file as usual..the only condition is that both files must be included in the page.Home Is Where the Wind Blowshttp://pushpontech.blogspot.com...

Reference js file from another js file
Hi, Is it possible to reference the functions from one js file in another js file? Any help is greatly appreciated. Thanks, Hey there, Try to include it with the include directive, that is put the following in your js file like <!-- #include file="yourfile.inc"--> really, i didnt try it, but it should work, let me know if it works CheerzThe best glimpse of heaven is on the way into hell ;)yousef.omar@gmail.comhttp://nonstopbiztalk.blogspot.com Assuming that you are using the javascript in a webpage, if you have references to both files then you sh...

Importing a .js file in another .js file......
Hello,I am having two javascript files. i want to use the function of 2nd javascript file into my 1st javascript file, How to do this, ??? In CSS if we want to use another css file then we can do it with @import but how to do the same in case javascript files....?????Prashant Here is one way to do it: Inside your first javascript file, you could have this function:function include_dom(script_filename) { var html_doc = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribute('language', 'javascript...

referencing .js files from withen another .js file
Hi: How can I include a reference to a js file to use for objects in another js file im looking for the code equivalent to "import" in vb.net, or "include" in c++ etc Thanks a lot, HF As far as I know there is no way to do it. All scripts should be referenced from hosting page and rendered in order of appearance. You can use objects from script already rendered.Leon LangleybenMCSD, ASP.NET MVPBlog I've seen code in .js files that does something like: document.write("<scr" + "ipt language='javascript' src='<Your include file>'></...

Referencing another js file in an external js file
HiI'm trying to do something simple all I need to do is to reference another javascript file inside a javascript file. Is there an "include" statement that I can use.Many thanks no , but you can write document.write('<script src="path" type="text\javascript" ></script>');SHASHANK BHIDECAPGEMINI INDIA"THE ROAD TO SUCCESS IS ALWAYS UNDER CONSTRUCTION MARK MY RESPONSE AS ANSWER TO HELP ME BUILD IT :)"  ok I had a feeling that was the case, no probs and cheers. Hi, Its very simple. Iin the  page where are referring...

Importing External JS files from an External JS file
 Hi Guys,I was trying to figure out a way to include an external js file from with in a js file.  Similar to a Import, or #include in C based languages.  I've tried writing a function that injects a <script> tag into the header of the document.  Here is what I'm trying:In test.js://function for including external *.js filesfunction inc(filename){ var head = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); script.src = filename; script.type = 'text/javascript'; head.appendChil...

Make js file to call some functions in client side
I do not like Java script but some times there is no another choice. In stead of writing Java script line by line every time, I like to create a JS file to store most often used methods and call this file through the RegisterScriptInclude() method. So far, I knew to add Alert("my message") to pop-up message box, can someone tell me where to find more useful Java script methods? Hi here are some examples http://www.4guysfromrolla.com/webtech/code/js.zip http://www.javascript-coder.com/html-form/javascript-form-validation.phtml hope this might help youmk...

how to call javascript function written within js file from server side code (code behind file) ?
Hi, I have js file containing all javascript functions required for my page. I am using ScriptManager.RegisterStartupScript to call javascript from code behind file. But for this i must  specify all javascript code from code behind file only. For eg.  if i use Page.ClientScript.RegisterStartupScript(typeof(System.String), this.ClientID + "_Init", strScript); where strScript contains <script>alert("hi");</script>, on page_Init event, this script is called. But when same script is embeded within a function  and i try to give function name in ...

How do I include other .js files from user.js?
My laptop and I move from client to client, and each site seems to have different proxy configurations. Right now, I use a script to (among other things) re-write my user.js file according to where I'm working, but I'd like to use a dedicated network_proxy.js that my user.js could include. That way, there's less danger of my other customizations getting clobbered. I tried to figure out how user.js and prefs.js get loaded, but couldn't decypher everything that was going on. Thanks! samwyse@gmail.com wrote: > My laptop and I move from client to client, and e...

How to include a js in another js file
Hello! I'm making a add-on extension and I have a problem to use functions that I defined in a javascript file. I have a directory Data and, in this directory, I have a file math_lib.js and a file cript.js. I'm trying to use the functions of math_lib.js in the cript.js, but this does not work. Someone has some idea? Thanks ...

including JS file in ascx file
formore then a day i try to include JS file in one of my user controls... i tried: <script src="myjs.js"></script>, anf tried to move the file to the same folde, to another folder, i used "~/foldder/mujs.js"and more and more... i allways get the same error- object required.... does it possible to include the JS file in the html of ascx file? if yes, how i do it? i justcan't find the way.... hi yani, its working here my side with following syntax <script language="javascript" type="text/javascript" src="sourcing.js" ></script> thanks, satish.Kind Attn: If a re...

Wrap js file into dll file
 Hi, I would like to wrap my javascript file (js) into my dll file after compiling. The same like the ajax control toolkit, the javascript files will be added into the dll file and execute automatically before init_page. I already tried to look at the source of ajax control toolkit but I could not follow it ways to implement it. Could you please help me to give me an example? Thanks in advance. here's an example: http://weblogs.asp.net/dwahlin/archive/2007/04/29/creating-custom-asp-net-server-controls-with-embedded-javascript.aspx    Mike Banavige~~~~~~...

Web resources about - js file inside js file and syntax error - asp.net.client-side

Inside Intercom
Brought to you by the team behind Intercom . We write about design, customer experience, start-ups, and the business of software.

Inside plant - Wikipedia, the free encyclopedia
... GR-513, Power Requirements in Telecommunications Plant (LSSGR Section 13) , contains detailed industry requirements for using power in an inside ...

Announcing Inside Social Apps NYC 2012
We’re excited to announce the first East-Coast edition of Inside Social Apps , happening in New York Dec. 3. This full-day conference will include ...

San Bernardino shooting: Texts describe scene inside US disability centre targeted in shooting
The father of a woman stuck in the California disability centre where a mass shooting took place describes the horror of those trapped inside. ...

Our look inside the Petersen Museum's beautiful renovations
... Automotive Museum has a whole new look after a 14-month renovation, and this gallery offers an early look at the gorgeous vehicles inside.

Mom shot in car with baby inside, St. Pete man charged
Christopher Keys is accused of shooting his ex-girlfriend while she drove a car with a baby inside.

Hackers hide malware inside Dropbox accounts to target media organizations
... offering a backdoor to their system. The way in which this is achieved is unique because its command and control or C&C server is hidden inside ...

Maps Minutes Hack #2: Save time navigating inside, not just outside
... series on how to save time this holiday season with Google Maps. The holiday season often means rushing around—both out on the roads and inside ...

CBS News goes inside San Bernardino shooters' home
Two-story apartment that California attackers called home opened to reporters

What The Hell Is NBC Doing Inside Attackers' Apartment?
I didn't have my TV on, but I saw my Twitter timeline explode: NBC, live on TV, rifling through the possessions of the San Bernardino attackers ...

Resources last updated: 12/5/2015 5:20:54 PM