copying scripts from forum?

P

Peter Goldfield

when I try and copy a script that you wonderful people have suggested I use
from here to the html section in Frontpage it gets sort of garbled - it's
obvious I know nothing of tags etc - anyone help?
To show willing I guess it's something to do with the line breaks <BR> -

this:

function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{
return qstr[qsvar];
}
}
var qstr = new qsobj();

becomes this:

function qsobj (){<BR> var qvbl;<BR> var qstring = "" +
document.location.search.substring(1);<BR> if (qstring != ""){<BR> var
qpairs
= qstring.split("&amp;");<BR> for (i=0; i &lt; qpairs.length; i++) {<BR>
qvbl = qpairs.split("=");<BR> this["" + qvbl[0]] =
unescape(qvbl[1].replace<BR>("+"," "));<BR> }<BR> }<BR>}<BR>function
getqsvar(qsvar){<BR> if (qstr[qsvar] == null){<BR> return "";<BR>
}else{<BR> return qstr[qsvar];<BR> }<BR>}<BR>var qstr = new qsobj();<BR>
 
S

Steve Easton

Copy and paste it into a blank notepad page first.
Then copy from notepad and paste it into your page in html view.


--
Steve Easton
MS MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
Peter Goldfield said:
when I try and copy a script that you wonderful people have suggested I use
from here to the html section in Frontpage it gets sort of garbled - it's
obvious I know nothing of tags etc - anyone help?
To show willing I guess it's something to do with the line breaks <BR> -

this:

function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] = unescape(qvbl[1].replace
("+"," "));
}
}
}
function getqsvar(qsvar){
if (qstr[qsvar] == null){
return "";
}else{
return qstr[qsvar];
}
}
var qstr = new qsobj();

becomes this:

function qsobj (){<BR> var qvbl;<BR> var qstring = "" +
document.location.search.substring(1);<BR> if (qstring != ""){<BR> var
qpairs
= qstring.split("&amp;");<BR> for (i=0; i &lt; qpairs.length; i++) {<BR>
qvbl = qpairs.split("=");<BR> this["" + qvbl[0]] =
unescape(qvbl[1].replace<BR>("+"," "));<BR> }<BR> }<BR>}<BR>function
getqsvar(qsvar){<BR> if (qstr[qsvar] == null){<BR> return "";<BR>
}else{<BR> return qstr[qsvar];<BR> }<BR>}<BR>var qstr = new
 
P

Peter Goldfield

thanks Steve - just 'cos I'm curious - Why? (other than that's the way to do
it)
 
S

Steve Easton

Copying and pasting into notepad removes any invisible *formatting* so what
you then paste into your web page is exactly what you see.
If you copy from a web page or an html e-mail or news group post, you also
copy the underlying *invisible* formatting that accompanies the text.
Pasting into notepad first removes it.

;-)

--
Steve Easton
MS MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
C

chris leeds

it's because you're copying marked up text. if you dump it into notepad
first it becomes plain text. another way to do it is insert/ advanced
control/ html and paste it into that box. (won't help unless it's going into
the body and not the head).
HTH
 
P

Peter Goldfield

hmm - sounds like a hang over from the "good" old days - should be possible
to strip out the formatting by having a "paste special" when in HTML -
better still turn eveything into a button! (g)
 
S

Steve Easton

There is a Paste special feature on the toolbar under Edit.

I still do it via notepad so I can *see* exactly what is being pasted. I
also paste when in html view,
which can't be done with Paste special.


--
Steve Easton
MS MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 
P

Peter Goldfield

that's what I meant Steve, paste special should strip formatting when
pasting in "HTML" tab (FP2002), thus eliminating extra stop. Not an enormous
chore but just seems unnecessary!
 
S

Steve Easton

Correct.
However it's a feature that I never use because I always paste in hmtl view.
Just an old habit of mine.

--
Steve Easton
MS MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top