PDA

View Full Version : Please help me. I'm a newb at this.


DawgieDog
12-19-2002, 02:39 AM
The problem I'm having for some reason is I can't have the status bar code(the one that scrolls text in the status bar) and the no right click code in the same page. Why is that? I'm using the HTML editor in Geocities. Any help will be appreciated :thumbsup:.

Admin note- Please read posting guidelines here regarding your thread's title/subject: http://www.codingforums.com/postguide.htm

DawgieDog
12-19-2002, 06:14 AM
Maybe I didn't explain the problem so well. What happens is the message that is suppose to pop up when you right click is scrolling on the bottom in the statues bar and the text that is suppose scroll in status bar is gone. Please help :(.

Skyzyx
12-19-2002, 06:33 AM
Either post a URL so we can check it, or post your source code in it's entirety (inside [ code ] ... [/ code] tags, of course). There's only about a trillion things that could be wrong with the information you gave us.

zoobie
12-19-2002, 08:35 AM
Left-handers just love those no right click scripts. Look...Chances are you really don't have anything worth "stealing" since you are fairly new and have gotten some of "your" material from other sites anyway (including the no right click, the status bar, and all the other scripts). Just drop the no right click and you'll be all set. Why you ask? Read this (http://www.codingforums.com/search.php?s=&action=showresults&searchid=51620&sortby=lastpost&sortorder=descending) for a few minutes. :D

jcmachado
12-19-2002, 03:49 PM
Hi DawgieDog,

First of all, there's no limit to how much JavaScripts you can have in one page. Normally, when you have two or more scripts in one page and some of them are not working properly the problem is always the same:Script conflict, what I believe that must be your case. Most of the Script conflicts are the result of one type of conflict duplication in event-handler access, in particular those concerning the BODY ONLOAD event handler.
Ok, you must be thinking, what does he mean?
Let me explain you using examples:
Lets suppose that your right-click script call "Script1" and that your status bar messenger call "Script2", ok?
The solution to your conflict is simple, but there's 3 different ways to solve the problem depending of your scripts.

First Case:

Script1: <body onload="dothis()">
Script2: <body onload="dothat()">
Solution- Remove one of the body tags and use something like that : <body onload="dothis();dothat()">

Second Case:
Script1: <body onload="dothis()">
Script2: window.onload=dothat()
Solution-Remove the window.onload line and use something like that: <body onload="dothis();dothat()">

Third Case:
Script1: window.onload=dothis()
Script2: window.onload=dothat()
Solution-Remove the window.onload lines and use something like that: <body onload="dothis();dothat()">

Doing one of the above things you'll be able to use the two scripts on the same page.

If you have some problem to setup your scripts just send them to me that I'll do it to you.

Take Care!!!

DawgieDog
12-19-2002, 10:11 PM
Here is the codes I am using. No right click: <!--

http://www.geocities.com/CollegePark/Quad/3400
http://javacentral.home.ml.org
http://www.page4life.nl/javacentral/index.htm

(c) 1997 Semian Software, Script by: Michiel steendam
Modify and use anyway you want, just mention this site.
-->

<SCRIPT>
<!-- Hide from old browsers

// All you have to do is put another text in the variable message.
// Don't forget to break all lines with a ^
// When you do not place a ^ at the end of all the message, the
// message will not repeat

message = "Welcome to the EMC official site!^" +
"Feel free to take a look around and download some files.^" +
"We will try and assist you as much as we can.^" +
"If you are interested in join the clan don't be scared and try.^" +
"Want to know about the clan some more? Simply click the About Us link.^" +
"And don't forget to sign our guestbook and maybe post in our great forums! =)^" +
"For questions and suggestions or anything else email the Webmaster(EMC_Dawgie_R) @ jsfd26@yahoo.com^" +
"Site created by EMC_Dawgie_R^" +
"Come back soon =]...^" +
"^"
scrollSpeed = 25
lineDelay = 1500

// Do not change the text below //

txt = ""

function scrollText(pos) {
if (message.charAt(pos) != '^') {
txt = txt + message.charAt(pos)
status = txt
pauze = scrollSpeed
}
else {
pauze = lineDelay
txt = ""
if (pos == message.length-1) pos = -1
}
pos++
setTimeout("scrollText('"+pos+"')",pauze)
}

// Unhide -->
scrollText(0)
</SCRIPT>


Status Bar:
<!--

http://www.geocities.com/CollegePark/Quad/3400
http://javacentral.home.ml.org
http://www.page4life.nl/javacentral/index.htm

(c) 1997 Semian Software, Script by: Michiel steendam
Modify and use anyway you want, just mention this site.
-->

<SCRIPT>
<!-- Hide from old browsers

// All you have to do is put another text in the variable message.
// Don't forget to break all lines with a ^
// When you do not place a ^ at the end of all the message, the
// message will not repeat

message = "Welcome to the EMC official site!^" +
"Feel free to take a look around and download some files.^" +
"We will try and assist you as much as we can.^" +
"If you are interested in join the clan don't be scared and try.^" +
"Want to know about the clan some more? Simply click the About Us link.^" +
"And don't forget to sign our guestbook and maybe post in our great forums! =)^" +
"For questions and suggestions or anything else email the Webmaster(EMC_Dawgie_R) @ jsfd26@yahoo.com^" +
"Site created by EMC_Dawgie_R^" +
"Come back soon =]...^" +
"^"
scrollSpeed = 25
lineDelay = 1500

// Do not change the text below //

txt = ""

function scrollText(pos) {
if (message.charAt(pos) != '^') {
txt = txt + message.charAt(pos)
status = txt
pauze = scrollSpeed
}
else {
pauze = lineDelay
txt = ""
if (pos == message.length-1) pos = -1
}
pos++
setTimeout("scrollText('"+pos+"')",pauze)
}

// Unhide -->
scrollText(0)
</SCRIPT>

My site where I have them: http://geocities.com/the_emc_site/index.html

DawgieDog
12-20-2002, 02:31 AM
*bump*:o. I need to finish this site as soon as possible. Please reply :( :cool: .

whammy
12-20-2002, 02:55 AM
Easiest solution (as stated above) which should also be a "quick fix":

Lose the "no-right-click" script. It is completely useless, since source code cannot be protected. This should also temporarily fix your variable conflicts.

Secondly (after you implement the fix above) you might want to visit http://www.javascriptkit.com and look at the javascript tutorials; there is a very good tutorial there which will help you to resolve conflicts like this in the future.

Happy programming! :)

jcmachado
12-20-2002, 11:40 AM
I can help your EMC site with the script conflict, but the scripts that you posted are the same. I think that you missed the right-click script.

DawgieDog
12-20-2002, 03:26 PM
You're right, they are the same.
Here....
No Right Click:
<script language="JavaScript"> <!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
//provided free at http://www.lissaexplains.com
// Don't delete this header!

var message="Sorry, that function is disabled.\n\nContents & Graphics Copyright İyour name\nOur work is not Public Domain, and should NOT be taken from this site."; // Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> </script>

Status Bar:
<!--

http://www.geocities.com/CollegePark/Quad/3400
http://javacentral.home.ml.org
http://www.page4life.nl/javacentral/index.htm

(c) 1997 Semian Software, Script by: Michiel steendam
Modify and use anyway you want, just mention this site.
-->

<SCRIPT>
<!-- Hide from old browsers

// All you have to do is put another text in the variable message.
// Don't forget to break all lines with a ^
// When you do not place a ^ at the end of all the message, the
// message will not repeat

message = "This is another example of a simple typewriter example^" +
"You can enter an unlimited number of lines here^" +
"Please, take a look at the code for a more detailed description^" +
"Created by Michiel Steendam^" +
"This typewriter will repeat now ...^" +
"^"
scrollSpeed = 25
lineDelay = 1500

// Do not change the text below //

txt = ""

function scrollText(pos) {
if (message.charAt(pos) != '^') {
txt = txt + message.charAt(pos)
status = txt
pauze = scrollSpeed
}
else {
pauze = lineDelay
txt = ""
if (pos == message.length-1) pos = -1
}
pos++
setTimeout("scrollText('"+pos+"')",pauze)
}

// Unhide -->
scrollText(0)
</SCRIPT>

RoyW
12-20-2002, 03:57 PM
Script1
message = "Welcome to the EMC
Script 2
var message="Sorry, that function

both have the same variable name. Try changing the right click to

<script language="JavaScript"> <!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
//provided free at http://www.lissaexplains.com
// Don't delete this header!

var alert_message="Sorry, that function is disabled.\n\nContents & Graphics Copyright İyour name\nOur work is not Public Domain, and should NOT be taken from this site."; // Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(alert_message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(alert_message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> </script>

jcmachado
12-20-2002, 05:41 PM
Hi DawgieDog,

Your nightmare is over!!! I've got the solution to your script conflict!
I took both scripts and put them together and I noticed that the message on the status bar seems to change to the message of the right-click, them I tought, maybe the problem is the name of the variables that the scripts are using, they must be the same! And that was, both scripts have a variable called "message", and when you run your page through a browser it has problems to decide which is the value to use.
Them to solve your problem, take one of the script and change the name of this variable, and your problem will be solved.
Below I took your right-click script and change the variable by myself, you just need to cut and paste the lines below to your page and all your problems will be overcomed!!!

<script language="JavaScript"> <!--
// No rightclick script v.2.5
// (c) 1998 barts1000
// barts1000@aol.com
//provided free at http://www.lissaexplains.com
// Don't delete this header!

var messageRight="No right Click is available!"; // Message for the alert box

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(messageRight);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(messageRight);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>



Take care, and have a good time!!!

DawgieDog
12-20-2002, 11:48 PM
Hey man, thnx a bunch! It works now! I'm all happy, now I can finish the site. Thanks again :).