This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#76 2008-10-01 22:20:21

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Html/css

Bobby500 wrote:

Hey, anyone the Javascript code to make a webpage change, depending on the link used to get into it? And change the page url? I doubt you can do that but still, I am asking. Also, what about those tool bars that change the content on the current page?

1.Don't understand.2.Kinda. Thats just either renaming files so you end up with this: www.yoursitenamegoeshere.com(or whtever extension you bought on your domain name)/name of other page.html(depending on you, you could make it with a bunch of extensions.) 3.That is done with javascript, and can make websites load very,very slow if the content is big enough. Much easier to do with multiple pages.

Offline

 

#77 2008-10-11 15:17:44

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: Html/css

Well can you tell me how to do number three anyways?

Offline

 

#78 2008-10-11 20:15:47

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: Html/css

Another question.

First off, how can I change a variable by one when a page loads, and then display that number in a text format? Like a counter.

Also, can I make a variable change to a random number between say 1 and 100 when someone loads the page and then have some content appear because of that. Like a random fact or something?

Here is my site that I am working on. www.crimsonking.t35.com

Last edited by Bobby500 (2008-10-11 20:22:51)

Offline

 

#79 2008-10-13 17:10:15

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Html/css

Bobby500 wrote:

Another question.

First off, how can I change a variable by one when a page loads, and then display that number in a text format? Like a counter.

Also, can I make a variable change to a random number between say 1 and 100 when someone loads the page and then have some content appear because of that. Like a random fact or something?

Here is my site that I am working on. www.crimsonking.t35.com

If you're trying to make a counter on your website, it won't work because Javascript is not Server Side. So when the page loads the variable will display 1 even if you show the page five hundred thousand million quadrillion gazillion times.

A random fact:

Code:

var randomNumber = Math.floor(Math.random()*101)
*/ but you can change the 101 to something else. For 10 facts, change it to 11, 7 to 8, etc. /*
if (randomNumber==1)
{
document.write("blah")
}
if (randomNumber==2)
{
document.write("blahblah")
}
etc, etc, until you have the desired number of facts.

Oh, and you can use PHP with T35.

You'll also find life much easier if you use the include() function I mentioned earlier.

Last edited by coolstuff (2008-10-13 17:12:38)

Offline

 

#80 2008-10-13 19:30:24

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: Html/css

Okay, then how do I make a counter?

Offline

 

#81 2008-10-17 06:15:55

Bobby500
Scratcher
Registered: 2008-04-19
Posts: 1000+

Re: Html/css

Anyone? Any ideas for a rating system either?

Offline

 

#82 2008-10-18 14:51:21

likegames
Scratcher
Registered: 2008-03-24
Posts: 100+

Re: Html/css

keroro645 wrote:

Is html free?
Whats CSS?

you don't download HTML *OR* CSS


There are 10 types of people in this world: Those who understand trinary, those who don't, and those who think this is the same old signature.
Three lines! (and base three!)

Offline

 

#83 2008-10-18 15:03:17

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Html/css

Here's a cool program for all web programming enthusiasts.
http://www.apachefriends.org/en/xampp.html

The program is called xampp. It allows you to host your own web server including mysql.

Once you set it up you can let other people access your web pages by typing out your ip address.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#84 2008-10-18 23:10:32

jcubed
Scratcher
Registered: 2008-07-23
Posts: 65

Re: Html/css

Why is this on scratch?????


Jcubed
Proud founder of Icdzat Productions.

Offline

 

#85 2008-10-19 13:52:52

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Html/css

jcubed wrote:

Why is this on scratch?????

Scratch is the outlet for many programming language discussions.

Offline

 

#86 2008-10-19 13:53:53

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Html/css

Bobby500 wrote:

Anyone? Any ideas for a rating system either?

For a counter or a rating system, PHP is your friend. I'm not good at PHP so I wouldn't quite know, but I'm sure you can find a tutorial using Google.

Offline

 

#87 2009-06-22 11:57:32

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Html/css

[bump] This was a really good topic, anyone?


Scratchin' since 2007

Offline

 

#88 2009-06-22 13:26:51

Mozaz
Scratcher
Registered: 2009-05-19
Posts: 500+

Re: Html/css

Thanks for this. We're doing a website task at school soon so this should help  big_smile


http://i33.tinypic.com/15i5fmp.png

Offline

 

#89 2009-07-01 09:58:43

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Html/css

Add ASP. It's server-side javascript. I know w3schools has something for it.

Offline

 

#90 2009-07-01 10:00:03

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Html/css

Bobby500 wrote:

Well can you tell me how to do number three anyways?

Look up Ajax.

Offline

 

#91 2009-07-01 10:02:43

AlanProjects
Scratcher
Registered: 2008-06-23
Posts: 500+

Re: Html/css

Add CGI too. Also on w3schools, And its what was used before ASP-ASP.ET-PHP where used. You basically get any programming language, and make a file that prints html and a declaration of its content, and you can do cool stuff with it.

Offline

 

#92 2010-04-22 07:10:57

Jason_9
Scratcher
Registered: 2010-04-22
Posts: 7

Re: Html/css

Thanks for the advice mate, been trying hard to learn html

Offline

 

#93 2010-04-22 13:39:52

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Html/css

This is nothing got to do with scratch. I am good at html my self, but this is a spam...  sad

Offline

 

#94 2010-04-22 15:37:57

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: Html/css

dav09 wrote:

This is nothing got to do with scratch. I am good at html my self, but this is a spam...  sad

A spam that has been left open since 2008... I would say has redeemed itself as not-spam.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#95 2010-04-23 13:38:33

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: Html/css

Yeah but most topics are closed, like we cant leave this happen again?

Offline

 

#96 2011-08-04 09:56:08

Thenuclearduck
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: Html/css

Look at this CSS file I made! You are free to use.

Copy code into  http://htmledit.squarefree.com

<style>
.menu{
position:relative
width:130;background-image:url(http://xtremecarpetcleaning.net/Media/Buttons/button%20background.bmp);
opacity:0.8;filter:alpha(opacity=80) 
text-shadow: white 1px 1px 2px;
padding:4; padding-left:10;padding-right:10;
-moz-border-radius: 1em 4em 1em 4em;
border-radius: 1em 4em 1em 4em;text-align:center;display: inline;     
-webkit-box-shadow:0px 0px 10px black;
-moz-box-shadow: 0px 0px 10px black;
box-shadow:0px 0px 10px black;
font-family:calibri;
}
a { text-decoration:none; font-size:14; color:#222;}
body {font-family:verdana ,sans-serif; background-image:url(http://profilerehab.com/myspace/images/small/black_stripes_design_10.jpg); color:white; font-size:13;
}
a:hover {font-size:16; color:#555;}
</style>


<div style="background-color:#333; height:60; padding:30; margin:100; -moz-border-radius: 4em 1em 4em 1em;
border-radius: 1em 4em 1em 4em;

-webkit-box-shadow:0px 0px 10px black;
-moz-box-shadow: 0px 0px 10px black;
box-shadow:0px 0px 10px black;

"><a href=""><div class="menu">Home</div></a>
<!-- Start menu -->
<a href=""><div class="menu" style="margin-left:-15px;">About</div></a>
<a href=""><div class="menu" style="margin-left:-15px;">Links</div></a>
<a href=""><div class="menu" style="margin-left:-15px;">Gallery</div></a>
<a href=""><div class="menu" style="margin-left:-15px;">Index</div></a>
<!-- End menu -->
<br>
<br><div style="background-color:#666; padding:20px;-moz-border-radius: 1em 4em 1em 4em;
border-radius: 1em 4em 1em 4em; color: orange;
text-shadow: 0px -1px 0px #999;

-webkit-box-shadow:0px 0px 10px black;
-moz-box-shadow: 0px 0px 10px black;
box-shadow:0px 0px 10px black;"><h3>Content</h3>Here is the content that will be displayed in the page. It can be anything, varying from just text to games and videos. </div><p align=center>Copyright © Company 2011- All rights reserved.</p>

What do you think?

Last edited by Thenuclearduck (2011-08-04 09:56:39)


http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1 is my newest project! It has http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=views&amp;num=1 views!

Offline

 

#97 2011-08-04 10:01:01

Thenuclearduck
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: Html/css

coolstuff wrote:

Bobby500 wrote:

Anyone? Any ideas for a rating system either?

For a counter or a rating system, PHP is your friend. I'm not good at PHP so I wouldn't quite know, but I'm sure you can find a tutorial using Google.

You can Make a counter in javascript... Here's the code:

<script type="text/javascript">

var clicks = 0;
function linkClick(){
document.getElementById('clicked').value = ++clicks;
}




</script><a href="#" onclick="linkClick()">Click</a>

<p><input id="clicked" size="2" ;="" value="0" readonly> people have clicked</p>


http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1 is my newest project! It has http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=views&amp;num=1 views!

Offline

 

Board footer