Oh great!!! how do i get this working for my website?
Wednesday, January 19, 2005 by joeKnowledge | Discussion: WinCustomize Talk
I'm trying to avoid php scripting and MySql for now and one way to organize text stories is to have them externally linked to somewhere else. That way I can just wrtie the story, then change it when I want to.
I am using the ducument.write i a text file and linking the text file to the spot on the page
script language = javascript text = "text/javastipt" src = "externalscript.txt"
But it won't work!!!
The file is in the same directory as the html file its suppossed to write on... ooooohhh what a world!!!!
any help on this?
(By the way, it suppossed to work on all browsers)
Reply #3 Wednesday, January 19, 2005 4:46 AM
This is what is suppossed to happen.
I have a javascript on another page. That javascript I call externaljavascript. All it does is put text on a webpage.
EX:
document . write (" This is just the beginning! ")
Without the spaces of course.
I save that as a txt file and place it on the server within the same folder as the html page it is suppossed to write on
Now on the webpage it is suppossed to write on... well it won't.
In the body of the webpage I put:
< SCRIPT LANGUAGE = " Javascript " TYPE=" text/javascript " scr = " gamessection2.txt">
< /SCRIPT >
(again, without the spaces)
In the book, it says it is suppossed to import the javascript and run it. When it runs, its suppossed to write the text:
This is just the beginning!
So far so bad... It must be something... a quote, a line something I am missing that I am just not seeing.
Also:
I don't know css as well as I would like (which is slowing me down in making a FireFox skin too) but I think I could do this with a div tage, but I am not sure. I think I can have a div tage 'write' something on the html document.
Basically what I am trying to do is set up my website so it is easier to edit text stories with out making a dynamic database. I write a story in a text file and the javascript calles it and puts it on the page. I can change content from one source.
Man... I really need to learn this building a website stuff faster! Eventually I will have to learn php amd MySQL.
Reply #4 Wednesday, January 19, 2005 6:27 AM
I spelled 'src' as 'scr'
That is why it wouldn't work.
Now it works but I can't just type like I want to. I want to be able to just type and the webpage externally link to what I types in the text file.
Anyway, I finally came up with the word combination on Google to get me what I want
http://www.webmasterworld.com/forum21/6602.htm
The only problem will be is if the person has javascript off then they won't see anything!!!
I also found some other solutions too. I could turn the html to php and have a php include. I think that would work. The only thing is that I have to upload it to test it. php doesn't work on my computer so I can't render the webpages until its on the server.
You even felt like your just spinning your wheels and gong nowhere fast?

Reply #5 Wednesday, January 19, 2005 8:32 AM
I always get a quick response there.

Reply #6 Wednesday, January 19, 2005 10:35 AM
Reply #7 Wednesday, January 19, 2005 3:34 PM
Reply #8 Thursday, January 20, 2005 1:04 AM
Does your server run php? If so, couldn't you just use an include statement
- < ? include "externalfile.txt" ; ? >
Or, maybe I'm misunderstanding what you're wanting?
I realize this involves php scripting, but it does avoid the javascript issue with browsers, and doesn't involve mysql or anthing to heavy php-wise.
Reply #9 Thursday, January 20, 2005 3:41 AM
You can, of course, have a include for javascript from somehwere else on the net, but the problem is that commas in whate ever you want the Javascript to write on the HTML page can be a problem.
There is a way around that by using the \" but can get complex when you have allot of code to place.
In he end, I am going to use the php included statement. The only problem for me is that I have to upload it to the server to see how it looks on the webpage (for my system is not linux).
At anyrate, this will make it easier to organize stories and active them as well.
I am really excited about this!!! I couldn't sleep because I was so excited. Really.
Reply #10 Thursday, January 20, 2005 10:18 AM
Reply #11 Thursday, January 20, 2005 4:43 PM
I have XP Home.
Reply #12 Thursday, January 20, 2005 11:03 PM
I honestly haven't tried it as I run XP Pro, but it might be worth a shot.
Reply #14 Friday, January 21, 2005 7:12 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Wednesday, January 19, 2005 2:54 AM
I'm thinking a simple iFrame might do what you're looking for.