# inserting java script into dreamweaver



## pmmanagement (Jun 21, 2003)

How do I instert Java Script I copied from a website into a Dreamweaver MX document. I do not have Flash, Fireworks, coldfusion or any of those great plugins.


----------



## Rockn (Jul 29, 2001)

You can just paste it in if it is copied code. Not any different than using notepad.


----------



## pmmanagement (Jun 21, 2003)

It has come to my attention that Dreamweaver MX has a built in, no turn off, for anything pasted to page that cleans up code function that rewrites all code and blocks javascript. Need to know how to work around it.


----------



## Rockn (Jul 29, 2001)

You are mistaken. It will paste and display HTML if you attempt to paste it into the preview pane instead of the code pane. I have cut and pasted plenty of Java into numeous web pages....never been a problem.


----------



## pmmanagement (Jun 21, 2003)

I'm trying hard to keep my cool about this, but it's getting harder and harder. II have code I need to copy from other websites onto my page. I have repeadedly tried to paste it. I've tried to just put my curser on the page and paste it from design view. I've tried to paste it into the code view, paste as html from design and code and I get zilch. It will not work. I either get just the text of the code or some other goobla ga....one of them insists that I 'turn on java' which I have searched dreamweaver for somewhere that I should turn something on to no avail. 
I promise you, that I can not paste these codes into my page and get it to work. PLEASE HELP ME.....I'll give you access to anything you need to look at this...I'm willing to pay someone that can help me... I'm not making this up....the code will not paste onto my pages.


----------



## pmmanagement (Jun 21, 2003)

I'm really sorry if I sound rude or ungrateful, because I don't mean to be. I'm just so frustrated. I'm begininning to think mabe I have some crazy version of software or I'm retarded or something. I know you probabably think I'm just making this up but I'm not. I have tried everything I can think of to paste this code into my page and it just will not work. I've even installed software to do it for me and it doesn't work either. PLEASE HELP ME. I'm almost in tears with this. Should I get another program?


----------



## bassetman (Jun 7, 2001)

Save it as an HTML file, open it in notepad or something similar and past the code in. I pull my hair out over DW! 

Re-save it and then you can edit further in DreamWeavever if you want.


----------



## pmmanagement (Jun 21, 2003)

I tried coping the html code given to me to copy from a website to word and saving as html file. then opening in notepad and resaving and then pasting code to webpage in DW..it still doesn't work. When opening on internet it shows nothing. On the page in design view I get message to 'turn on java to view hitbox'... but nothing shows when I open page on site ????? Should I consider using another software? I hate to, I've already invested $200 in upgrading DW, and until now liked working with it.


----------



## bassetman (Jun 7, 2001)

If you posted it, can you give a link? We can look at the code.


----------



## pmmanagement (Jun 21, 2003)

Here's the link and I posted it on my main page to my website and now over 3/4 of my page is missing AHHHGGGGG , but here you go check out the code. I just hope I can get my original page back. Is this me??? am I an idiot???
I really do appreciate your trying to help me and I promise I'm doing my best to maintain composure.


----------



## pmmanagement (Jun 21, 2003)

Sorry www.neonbeerlights.com is link


----------



## bassetman (Jun 7, 2001)

The only thing that jumped out at me as a problem is this (if you are on a UNIX server)


> test ads


Like I said if UNIX, the space between "test" and "ads1" would be a problem.

Nothing else appears wrong at a glance.

Can you post your script you want to use betweet the

```
tags here?
```


----------



## lola2001 (Jan 29, 2001)

In Dreamweaver MX, click File> New and choose Javascript. Copy your script there and save it as a .js, dreamweaver should automatically add the ext. for you.


----------



## bassetman (Jun 7, 2001)

Nice tip lola, I haven't taken the plunge to MX yet!


----------



## pmmanagement (Jun 21, 2003)

Hey everybody,
I want to say THANK YOU from the bottom of my heart to all of you wonderful people that took the time to help me. I haven't ever experienced anything like the response I've recieved from this site. You guys are great.

I finally got a Dreamweaver Tech -alive and on the phone---and Guess What?? There is a bug in Dreamweaver MX 6.0, that automatically cleans up html - rewrites code and can block javascript when pasting directly into page. but Macromedia has issued an update to 6.1...(free download) that fixed it. The update allows you to manually control it. I've only done this on my own a couple of times but (knock on wood) so far so good...
I've been able to paste code into a document in code view, then going to design view & saving document. Part of my problem with one of the codes was it was written weird & he revised it the first time, but after updating, I was able to paste it into notepad & then copy it into code view of my DW doc.

I hope that by sharing this, that it will help somebody else somewhere down the line.

Thanks again
Denei
(Madene - [email protected])


----------



## lola2001 (Jan 29, 2001)

So glad you got it worked out. Could you post the link where you got the patch if possible? That would help others with the solution.


----------



## pmmanagement (Jun 21, 2003)

Sure thing, anything I can do to help.

http://www.macromedia.com/support/dreamweaver/ts/documents/updater.htm

OR

http://www.macromedia.com/support/dreamweaver/
and choose link for
16756 Dreamweaver MX Updater

IMPORTANT:
Read the Release Notes before downloadiing.


----------



## bassetman (Jun 7, 2001)

I'm sure your information will help some people here!

John


----------



## maniakaz (Oct 12, 2005)

Well, I face the same problem.
I am using DW MX.
I have downloaded Sothink HTML menu trial version. Then I constructed a 3-level cross frame menu. Saved itas*.js file.
So far so good...untill I launched Dreamweaver.
There I created 2 frames: left and main (named lame - untitled...).
Switched do code view.
Entered all copied js file text there:

// JavaScript Document
stm_bm(["menu0024",600,"","blank.gif",0,"","",0,0,0,0,50,1,0,0,"","",0,0,1,0,"default","hand",""],this);
stm_bp("p0",[1,4,0,0,0,3,0,7,100,"",-2,"",-2,90,2,2,"#999999","transparent","",3,0,0,"#FFFFFF"]);
stm_ai("p0i0",[0,"Lietuva","","",-1,-1,0,"","_self","","","","",0,0,0,"arrow_r.gif","arrow_r.gif",7,7,0,0,1,"#FFFFFF",1,"#FFFFFF",1,"xp3.gif","xp3.gif",3,3,0,0,"#FFFFFF","#FFFFFF","#333333","#000000","bold 12pt Arial","bold 8pt Arial",0,0]);
stm_bpx("p1","p0",[1,2]);
stm_aix("p1i0","p0i0",[0,"Vilnius"]);
stm_bpx("p2","p0",[1,2,0,0,0,3,0,0]);
stm_aix("p2i0","p0i0",[0,"Autobusai","","",-1,-1,0,"","_self","","","","",0,0,0,"","",0,0]);
stm_aix("p2i1","p2i0",[0,"Troleibusai"]);
stm_aix("p2i2","p2i0",[0,"Kitas transportas"]);
stm_ep();
stm_aix("p1i1","p0i0",[0,"Kaunas"]);
stm_bpx("p3","p2",[]);
stm_aix("p3i0","p2i0",[]);
stm_aix("p3i1","p2i1",[]);
stm_aix("p3i2","p2i2",[]);
stm_ep();
stm_aix("p1i2","p2i0",[0,"Kiti miestai"]);
stm_aix("p1i3","p2i0",[0,"Vietinis susisiekimas"]);
stm_ep();
stm_aix("p0i1","p0i0",[0,"Usienis"]);
stm_bpx("p4","p2",[]);
stm_aix("p4i0","p2i0",[0,"Latvija"]);
stm_aix("p4i1","p2i0",[0,"Estija"]);
stm_aix("p4i2","p2i0",[0,"Ukraina"]);
stm_aix("p4i3","p2i0",[0,"Rusija"]);
stm_aix("p4i4","p2i0",[0,"buv.SSSR"]);
stm_aix("p4i5","p2i0",[0,"Prancuzija"]);
stm_aix("p4i6","p1i2",[]);
stm_ep();
stm_aix("p0i2","p0i0",[0,"Apie mus"]);
stm_bpx("p5","p2",[]);
stm_aix("p5i0","p2i0",[0,"Kas mes?"]);
stm_aix("p5i1","p2i0",[0,"Naujienos"]);
stm_aix("p5i2","p2i0",[0,"D.U.K"]);
stm_aix("p5i3","p2i0",[0,"Pramogos"]);
stm_aix("p5i4","p2i0",[0,"Menu Item 1"]);
stm_ep();
stm_ep();
stm_cf([2,0,0,"Main_frame","Navigation_frame",1]);
stm_em();

No results - I mean, left frame is absolutely empty while my menu should be right there.
What went wrong? How may I correct the situation?
please, i need your help!!


----------



## cristobal03 (Aug 5, 2005)

Erm, did you read the whole thread? OP linked a DW patch...post #17. Also explained the problem, post #15.

GL,

chris.


----------

