webspeed doesn't support .js file ???

meLikeNoOther

New Member
hello!!
i have this .js file and i plan to reuse it so that i could save space but it seems that webspeed doesn't read .js file. i have already saved the .js file in the webpage directory using the procedure editor but it doesn't work. i have tried to save the .js file in notepad and it works.
if this is the case how could i reuse my js functions?? please help!!! :confused: forgive my ignorance, i'm still new in this environment..:blush1:
 

Casper

ProgressTalk.com Moderator
Staff member
The js file has to be placed on the webserver in a path relative to the web root dir.
WebSpeed doesn't use javascript, it has to reside on the webserver. WebSpeed is just a way to generate HTML pages which are handled by the webserver like any other HTML page.

Example:
Code:
<html>
  <head>
    <title>Whatever</title>
    <script src="/js/somefunctions.js"></script>
  </head>
  <body>
  /* put your HTML stuff here */
  </body>
</html>

This external javascript file (somefunctions.js) has to be on the webserver in a directory named js.
If you look in the error log of the webserver then you will probably see that the javascript file could not be found....

So check if you put the js file in the roght place on the webserver.

HTH,

Casper.
 

meLikeNoOther

New Member
i got it:)..the problem is i don't have the right to add a directory, maybe i would just have to bring it up to our head..

i'll just post here what happens then..thanks..
 

Casper

ProgressTalk.com Moderator
Staff member
You could also put the js script directly in rootdir, although that is not the best way to organise stuff on a webserver...

Good luck,

Casper.
 

rcgomez11

Member
Mr. Casper, im also having hard time configuring my files to where exactly should i place my js file..i know you can help me alot..my server is apache, there i place my files(.html files) under the htdocs folder there..am i not right of placing my .js files inside that root directory?where is that webserver you are talking about...hope for your kind response...tanx mr. moderator....
 

gean melo

New Member
you can by the file.js anywhere
But the path of the directory where you place
its file.js has to be added in propath if you did not do it now.


Well can make reference to the file.js in two ways:

1 - when the file.js is external.

Ex: <script type="text/javascript" src="/propath/file.js"> </ script>

2 - have a file.html / htm with the contents of the javascript
and in the main program call this file as:

<script language="speedscript">

Run file.html/htm .

</script>

starting this is possible using any function that is into the file.html / htm.

I hope I have helped.
 

Casper

ProgressTalk.com Moderator
Staff member
Just a thing to add to this, if the java script is external then it has to reside on the webserver.
Since more then one website can run on a webserver it is best to make seperate directories for the different javascript source code files on the webserver.
In the example I gave earlier I did put the javascript source code files in a directory called js in the document root.

BTW, the webserver is the server where the messenger resides. In most configurations I know the messenger is on the webserver and all the other stuff (nameserver, webspeedbroker) reside on the database server.

HTH,

Casper
 

gean melo

New Member
but when I spoke that the file can be anywhere I mentioned in any directory of the server,

and when it makes use of an external file.js is a good reuse of code.
 

rcgomez11

Member
gean melo,thank you for your reply..now i can implement external js files...i cant figure how to do your first command,which is make a propath for my js directory,the second suggestion make my codes running....thank you so mch..and also to our moderator,thank you sir.

just wanted to add,if you still have time,im experiencing problem when i'm attempting to add records to my database,heres my code:

<html>
<head>
<title> Another Add Program </title>
<script language="javascript">
function sfocus() {
document.romel.rsys.focus();
}
</script>
</head>
<body onLoad = "sfocus()">
<script language="speedscript">
if get-value("rad") <> "" then do:
create assessment-roll.
assign assessment-roll.owner-name = get-value("rsys").
queue-message(""," Added Successfully ").
end.
</script>
<form name="romel" method="post" action="entry1.html">
Name: <input type="text" name="rsys" size="15" />
<input type="submit" name="rad" value="Submit" />
</form>
</body>
</html>

i also post this to another thread,but because somebody like you reply to me here, i also take advantage of posting it here,mr. moderator, please help me again,i rilly need this code..the edit and delte function is alredy running,just this one,i cant figure out how to fix this...the first time i try to add record to my database,it adds successfully then after that no more addition has been made,upto now...any help will be appreciated...thanks in advance...
 

gean melo

New Member
try it ,


<html>
<head>
<title> Another Add Program </title>
<script language="javascript">
function sfocus() {
document.romel.rsys.focus();
}
</script>
</head>
<body onLoad = "sfocus()">
<form name="romel" method="post" action="entry1.html">
Name: <input type="text" name="rsys" size="15" />
<input type="submit" name="rad" value="Submit" />

<script language="speedscript">
if request_method = "POST" then do:
create assessment-roll.
assign assessment-roll.owner-name = get-value("rsys").
queue-message(""," Added Successfully ").
end.
</script>
</form>
</body>
</html>


tips:
-- Try the function request_method identified that if the request was a get or a post.

eg. if request_method = "get / post" then
....
.....

-- Put everything between the tag form, which refers to all commands progress eg. functions, procedures, includes,
variables etc. ...

-- Try to find out if there is some trigger to make some sort of validation in the creation of the data.

-- Be careful with the index, we can not have data in the table with the same index .

i hope i have helped .
 
Top