javascript picture insert?

P

Peter Goldfield

Difficult one to explain...
I'm trying to place a picture on a page "offer_form.htm" by linking from
page "A"

The link is:
.../../../secure_forms/offer_form.htm

so far so good

I have a script in the <head> section on "offer_form.htm" which goes like
this:

<script>
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();
</script>

AND where I want the picture to appear, in the body I have:

<script>
document.write('<img src="' + getqsvar("pic") + '">');
</script>

In the PARAMETER values of the link from page"A", the name is "pic" (without
quotes) and the value
"goldfield/shows/afss/afss_detail/butterfly_whole_small.jpg" which is the
path to the .jpg I want to appear in "offer_form"
Thus the whole link reads:

.../../../secure_forms/offer_form.htm?pic=goldfield/shows/afss/afss_detail/bu
tterfly_whole_small.jpg

If anyone's read this far you won't mind the expletives that occur 'cos I
can't get the xxx thing to work!
If I publish the files to my site and click the "offer" link I get a small
redx in a picture box whose properties are described as below:

http://www.duckspool.com/goldfield/...ws/afss/afss_detail/butterfly_whole_small.jpg

This is gobbledegook, what am I doing wrong?
I've made the whole shebang work in a new practice web, but now I'm doing it
for real, it's not happening

The link to see what's happening is:
http://www.duckspool.com/goldfield/shows/afss/afss_detail/butterfliessp.htm

Any help would save premature insanity (perhaps too late)
 
S

Steve Easton

Looks fine to me in IE 6

Try cleaning up the browser cache and history files on your machine.
Also find and delete all *.web and *.tmp files.


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

Steve Easton

Oops never mind I forgot to click the offer link.


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

Crash Gordon

Peter,

Outta curiosity, on the butterfly pages url you listed...what is the little gray door on the right side, then I see two more gray vertical rectangles. Are they gonna be something or do I have stray artifacts?

Prematurely insane as well,
Robo


| Difficult one to explain...
| I'm trying to place a picture on a page "offer_form.htm" by linking from
| page "A"
|
| The link is:
| ../../../secure_forms/offer_form.htm
|
| so far so good
|
| I have a script in the <head> section on "offer_form.htm" which goes like
| this:
|
| <script>
| 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();
| </script>
|
| AND where I want the picture to appear, in the body I have:
|
| <script>
| document.write('<img src="' + getqsvar("pic") + '">');
| </script>
|
| In the PARAMETER values of the link from page"A", the name is "pic" (without
| quotes) and the value
| "goldfield/shows/afss/afss_detail/butterfly_whole_small.jpg" which is the
| path to the .jpg I want to appear in "offer_form"
| Thus the whole link reads:
|
| .../../../secure_forms/offer_form.htm?pic=goldfield/shows/afss/afss_detail/bu
| tterfly_whole_small.jpg
|
| If anyone's read this far you won't mind the expletives that occur 'cos I
| can't get the xxx thing to work!
| If I publish the files to my site and click the "offer" link I get a small
| redx in a picture box whose properties are described as below:
|
| http://www.duckspool.com/goldfield/...ws/afss/afss_detail/butterfly_whole_small.jpg
|
| This is gobbledegook, what am I doing wrong?
| I've made the whole shebang work in a new practice web, but now I'm doing it
| for real, it's not happening
|
| The link to see what's happening is:
| http://www.duckspool.com/goldfield/shows/afss/afss_detail/butterfliessp.htm
|
| Any help would save premature insanity (perhaps too late)
|
|
 
C

Crash Gordon

nevermind - now i see the alt text for the gray door and rectangles.

R.


| Difficult one to explain...
| I'm trying to place a picture on a page "offer_form.htm" by linking from
| page "A"
|
| The link is:
| ../../../secure_forms/offer_form.htm
|
| so far so good
|
| I have a script in the <head> section on "offer_form.htm" which goes like
| this:
|
| <script>
| 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();
| </script>
|
| AND where I want the picture to appear, in the body I have:
|
| <script>
| document.write('<img src="' + getqsvar("pic") + '">');
| </script>
|
| In the PARAMETER values of the link from page"A", the name is "pic" (without
| quotes) and the value
| "goldfield/shows/afss/afss_detail/butterfly_whole_small.jpg" which is the
| path to the .jpg I want to appear in "offer_form"
| Thus the whole link reads:
|
| .../../../secure_forms/offer_form.htm?pic=goldfield/shows/afss/afss_detail/bu
| tterfly_whole_small.jpg
|
| If anyone's read this far you won't mind the expletives that occur 'cos I
| can't get the xxx thing to work!
| If I publish the files to my site and click the "offer" link I get a small
| redx in a picture box whose properties are described as below:
|
| http://www.duckspool.com/goldfield/...ws/afss/afss_detail/butterfly_whole_small.jpg
|
| This is gobbledegook, what am I doing wrong?
| I've made the whole shebang work in a new practice web, but now I'm doing it
| for real, it's not happening
|
| The link to see what's happening is:
| http://www.duckspool.com/goldfield/shows/afss/afss_detail/butterfliessp.htm
|
| Any help would save premature insanity (perhaps too late)
|
|
 
P

Peter Goldfield

gagging to reply to Robo and Steve, if only I could answer my own
questions...sigh...
 
C

Crash Gordon

i'm seeing the dreaded red x box there now...wasn't there earlier (on the offer page)


| gagging to reply to Robo and Steve, if only I could answer my own
| questions...sigh...
|
|
 
S

Steve Easton

Don't gag, spit it out.
Been one of those days here too.
Looking at the script right now.

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

Peter Goldfield

I had my first computer in 1978 and after learning how to run a program that
said "what is your name" entering "Peter" and having it say "your name is
Peter", I vowed never to learn anything more about programming, and have
waited patiently, sometimes for years, for WYSIG to come out of my 51/4 inch
floppies.
Should I not be proud to almost understand JavaScript in 72 hours?
(understand the principle that is, not be able to use it!)(g)

Love and Respect
 
P

Peter Goldfield

W hat Y ou S ee I s Good, with the emphasis on SEE (in case you thought I'd
made a mistake! - as if!) and yes I know pride comes before a fall!!....
 
S

Steve Easton

LOL
You should be quite proud. I'm a javascript fan myself, and have a project
I've been toying with for several weeks.
Can't get it to do "exactly" what I want but I'm too stubborn to ask for
help.....yet.
;-)

What I'm thinking is that the script isn't parsing out the image location
that's being passed via the href / url in page A
Obviously the image info is being passed because it's visible in the address
bar when the new page opens.
You need to capture the entire url which can be done with this in page B:
( I think )

var win = external.menuArguments;
document.all.location.value = win.document.location.href;
document.all.location.select();

and then strip out everything before ? and pass the remainder as a variable,
as the image src.

Or, either Jon Spivey or Kevin Spencer posted a way to pass a variable from
one page to another a while back
which would be the ultimate answer. Unfortunately I didn't save the post.

I'll poke around some more and post back in a while.

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

Peter Goldfield

Steve
Jim Buyens originally gave me this script, and as I mentioned I got it to
work fine in a test web. Could it have something to do with where the "pic"
line is placed in page "B" ?(inside a table inside "body")
 
P

Peter Goldfield

OK the plot thickens...
I've got it to work BUT only if the picture I'm trying to transfer is in the
SAME folder as the page (B) to which I'm trying to send it.
If I place it in a nested folder and direct the parameter value path
correctly it doesn't work.
NOW I had that experience in the test site and kicked myself after finding
that the reason it didn't like it was that I had some spaces in files and
folders. Once I'd removed them, all was OK
SO
I went to my real site and removed spaces - at least in folders - I used a
utility called Jimco remove space which didn't work quite properly! - it did
everything in the root files but didn't work on folders - so I went through
all folders that would affect what I'm trying to do.
Something is not right somewhere!!!
I've tried e-mailing Jimco but perhaps he's busy.
 
T

Thomas A. Rowe

One you have the spaces removed, how about trying to use absolute URLs to
your images?

i.e., http://www.yourdomainname.com/imagefolder/imagename.jpg

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
 
P

Peter Goldfield

Thomas and Steve - once again enormous thanks for help and good humour -
it's been fun....
I've cracked the problem after much fingerwork and brain damage.
I noticed that if the picture and form were in the same folder all was OK,
but that was impractical for hundreds if not more of pictures.
By much playing around I found it wasn't the folder where the PICTURE
resided that was the problem but the position of page "B" the form - once
I'd taken it from the folder of "forms" and put it in the root with
homepages and index etc everything worked fine.

So 2 questions for you savants:
1. Why?
2. When I get round to publishing the forms to the space I have on a secure
server, am I going to have big trouble again?!
 
T

Thomas A. Rowe

Personally, I do my best to avoid using JavaScript for anything other than
popup windows and form field validations.

I would think that you will face the same issue all over again, if using a
share SSL certificate, whereas if you purchase your own, and have it applied
to your entire domain, everything should continue to work as you have
working now.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
 
P

Peter Goldfield

Thanks Thomas,
Could you point me to where I can find out what "SSL certificates","buying
my own" and "applying to my whole domain" means - very simply! - I'm afraid
'tis newbie time for this struggling artist!
 
T

Thomas A. Rowe

First place to start is with your host for purchasing, as you will need to
provide you with a small file.

SSL Certificate is a verification of who you are.

The SSL Certificate is what causes the Lock to appear in the bottom status
bar of your browser, and also allow the site to be accessed via https://

Applying to your whole domain means that the SSL Certificate is purchased by
you, and your host installs it on their server for your domain, then you can
use https:// to access any page within your domain.

With a shared SSL, you can on access the folder that the host has rented you
access to their SSL Certificate.

The SSL Certificate is what causes the Lock to appear in the bottom status
bar of your browser, and also allow the site to be accessed via https://

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
 
M

MD Websunlimited

Hi Peter,

http://www.google.com

There is a wide range in pricing for SSL certificates, e.g., $499 -- $69. Check with your ISP / WPP first to see if they support
what ever you provide them. Otherwise, they may have some restriction, why I don't know, that you have to follow.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Stop Spam Email Mining from your web pages with SpamStopper
http://www.websunlimited.com/order/product/SpamStopper/spam_stopper_help_dir.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
 
P

Peter Goldfield

Thanks all, my SVP's going to love me on Monday!...
I have a secure area but I'm told I only can access now via FTP which phased
me a bit, and now they want me to send the forms by e-mail everytime I make
a change!
Think I'll sort them out with your notes by my side!
Bet they hate these ingénues!
 

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