Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem running js in cfm page

Status
Not open for further replies.

TruthInSatire

Programmer
Aug 12, 2002
2,964
US
Hi all. I posted a question in the JS forum but it looks like it fell off the charts. The post is thread216-874106

please help.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Curious:
Code:
here's
Appears in:
Code:
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons)
writeRichText('staffPageText', 'here&#39;s the "<em>preloaded</em> <b>content</b>"', 400, 200, true, false);
//-->

Wonder if doubling up the # would allow CF to escape it without breaking the JS.

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
I'm gonna say something really stupid but its worth a shot if Deziner's not right..

Did you define a doc type at the top of the page? You'd think I could have checked except for some reason, notepad and IE aren't talking on my computer anymore.. View Source doesn't work.

It might be that the htm is assuming and the cfm is not..

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
thanks for your help so far.

webmigit, you must have winxp and notpad on your desktop. change the name of the notepad.exe on your desktop to something else like npad.exe that will fix your problem.

As for the # sign in the content; I've tried it with nothing in there and it still breaks. keep in mind the page is 100% html no coldfusion is processed at all except for the application.cfm page which only sets the session management, nothing else. I even copied and pasted the source from the cfm page into antoher htm page and it worked fine. That kind of makes me wonder if cf isn't doing something to the .js file. Is that possible?

webmigit if that doesn't fix your view source problem here it is from the htm page that works. the cfm page is the same with the exception of the white space generated by the application.cfm file:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<script language="JavaScript" type="text/javascript" src="richtext_compressed.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form name="StationSettings" action="demo.htm" method="post">


<script language="JavaScript" type="text/javascript">
<!--
//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/rte/", "", "");
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons)
writeRichText('staffPageText', 'here&#39;s the "<em>preloaded</em> <b>content</b>"', 400, 200, true, false);
//-->
</script>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Try changing... "here&#39;s the "<em>preloaded</em> <b>content</b>"

to "this is the "<em>preloaded</em> <b>content</b>"

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Thanks!

That didn't do it but it got me on the right track.. what I had to do was clear temporary internet and the temp folder manually..

But now I have view source back.. makes things so much easier.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I've done better than that I replaced '"here&#39;s the "<em>preloaded</em> <b>content</b>"' with '' still nothing.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Ok between talking to you and the JS guys i got it working.

I don't know why but cf was doing something to the .js file. i copied the contents of the .js and put it on the same page between script tags and it works.


THANKS

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
To pull a rabbit out of my hat because that makes no sense because cf, unless specified cannot [see: is not supposed to) affect a js extension.

Its possible that the cf was dumping in parts, rather like cfflush was being used (even though it wasn't) and so the js actually loaded for the browser before the file.

It just seems if anything, that'd be the only possibility.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
I know what you mean, i'm stumped too. I've run into a rash of stupid solutions to problems that shouldn't be problems. Like renaming a file so a user could access the page, adding a join to make a select with speratic returns work correctly... not to mention once i got the box to appear it took me 3 hours to get it to work in my form. Changing one thing at a time exorsizing proper trouble shooting, the only problem i could see is some of the other script tags had to be in a certian location in the document (outside of the head tags - between the form tag) another querk i've never run into before. It still doesn't show up for some people so i've got to translate the asp or php examples to filter the bad stuff out and replace it with something that the rte / coldfusion can both agree on.

I'm curious to find out what the problem is with the .js file however i'm in a time constraint right now so i'll back track the issue once time permits. that .js file has almost 800 lines i'd rather not have right on my pages.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Where did you find that WYSIWYG? I like it a lot.. Its much less advanced than the one I used but that's preferrable to me.

I use FCKEditor.

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Funny the way i found it. I'm building an application that does a whole bunch of stuff. I get approached by someone that says "hey I have this great web app i'd like to sell you." so i go look at it and come to find out its a scheduler, which is just PART of the whole application i'm building. I asked him how far back he designs for browser compatibility, he said "due to this thing its ie5 and ns6..." he geve me the link to the environment so now i'm trying to use it in my app. its free if you use it in cfm pages let me know what kinds of problems you get and if you work them out.

Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so.
-Douglas Adams (1952-2001)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top