IFRAME and links

new BookmarkLockedFalling
mackrackit
Full Member
***

mackrackit Avatar

Posts: 231

Post by mackrackit on Feb 3, 2008 9:32:12 GMT -5

Hi,
When I have an IFRAME in a page with a link and the link is clicked, RB takes me back to the login page.
How do I fix it?
Thank you.

[START]
cls
print "HI"
print " "
link #m, "DO SOMETHING", [do]
print " "
html "<IFRAME SRC=""http://libertybasic.com/"" WIDTH=600 HEIGHT=400 ALIGN=CENTER>"
wait
goto [START]

[do]
'do something
goto [START]

Dave[br][br][url]http://www.mackrackit.com:8888[/url][br]
mikeukmid
Guest

Guest Avatar

Post by mikeukmid on Feb 3, 2008 10:40:33 GMT -5

Looks like a bug.
Also if you rearrange the position of the link, to be below the iframe, the link disappears. (both MSIE and FF2)

[START]
cls
print "HI "+dm$
print " "
html "<div id=""IFR"" ALIGN=""CENTER""><IFRAME SRC=""http://libertybasic.com/"" WIDTH=""600"" HEIGHT=""400"" ></div>"
print
print
div lnks
link #m, "DO SOMETHING", [do]
end div
wait
goto [START]

[do]
'do something
dm$="Do more!"
goto [START]
Last Edit: Feb 3, 2008 10:41:12 GMT -5 by mikeukmid
carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

mikeukmid
Guest

Guest Avatar

Last Edit: Feb 3, 2008 13:42:56 GMT -5 by mikeukmid
mackrackit
Full Member
***

mackrackit Avatar

Posts: 231

Dave[br][br][url]http://www.mackrackit.com:8888[/url][br]
metro
Full Member
***

metro Avatar

Posts: 207

Post by metro on Apr 21, 2017 3:01:47 GMT -5

Hi,
is there a way of using a variable for the url for example...

url2find$="http://libertybasic.com/"

[START]
cls
print "HI "+dm$
print " "
html "<div id=""IFR"" ALIGN=""CENTER""><IFRAME SRC= url2find$ WIDTH=""600"" HEIGHT=""400"" ></div>"
print
print
div lnks
link #m, "DO SOMETHING", [do]
end div
wait
goto [START]

[do]
'do something
dm$="Do more!"
goto [START]
Last Edit: Apr 21, 2017 3:02:51 GMT -5 by metro
Intel Core2 QUAD CPU @2.54 x 4 Mint Linux 19.3 Mate
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

metro
Full Member
***

metro Avatar

Posts: 207

Intel Core2 QUAD CPU @2.54 x 4 Mint Linux 19.3 Mate
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Apr 21, 2017 15:36:39 GMT -5

metro Avatar
Thanks Carl,
Can you explain why 3 double quotes I did try 2 and other combos
Before posting

Laurie


Yeah, three double-quotes looks funny. You will only see that at the beginning or ending of a string literal.

When you construct a string literal doubling up on double-quotes inside in between the beginning and ending of the string literal makes one double quote, so:

"this expression ""has"" a word surrounded by quotes"

and

"""this expression is completely surrounded by quotes"""

In the second example, the first double-quote is the beginning of the string. After that, each pair of double-quotes makes for one double-quote in the string, When you get to the end of the string there is a pair of double-quotes which becomes one double-quote in the string, and then the third double quote defines the end of the string.

Imagine that the compiler sees it more like this:

" ""this expression is completely surrounded by quotes"" "

In the case of your url2find$ question, it may look like my suggested solution below is just one string and that the triple double-quotes are in the middle of the string.

"<div id=""IFR"" ALIGN=""CENTER""><IFRAME SRC="""+url2find$+""" WIDTH=""600"" HEIGHT=""400"" ></div>"

But, you actually have three things that are concatenated using the + operator:

"<div id=""IFR"" ALIGN=""CENTER""><IFRAME SRC="""
+
url2find$
+
""" WIDTH=""600"" HEIGHT=""400"" ></div>"

Notice that the use of three double-quotes together is used at the end of the first line, and at the beginning of the last line. You cannot define a string literal with three (or any odd number grouping) in the middle of a string literal.

But, you can do four, or six, or eight, etc. Like so:

print "Here are four """""""" quotation marks."

Try adding or removing one of these quotation-marks in the middle of the string and you will get a compile error.

Now I've said too much. ;-)

-Carl
Last Edit: Apr 21, 2017 15:39:07 GMT -5 by Carl Gundel - admin
metro
Full Member
***

metro Avatar

Posts: 207

Intel Core2 QUAD CPU @2.54 x 4 Mint Linux 19.3 Mate
kokenge
Senior Member
****

kokenge Avatar

Posts: 261

Post by kokenge on Apr 22, 2017 10:14:30 GMT -5

Since HTML can use single quotes or double quotes, I always use the single qoutes. Just looks a lot better. And stuff like align and width and height don't need quotes , I write it as follows:url2find$="http://libertybasic.com/"
html "<div id='IFR' ALIGN=CENTER><IFRAME SRC="+url2find$+" WIDTH=600 HEIGHT=400 ></div>"e

HTH .
Have a g'day.
BTY I'm in las vegas for the weekend.. and broke.. Help!
Carl Gundel - admin
Administrator
*****

Carl Gundel - admin Avatar

Posts: 550

Post by Carl Gundel - admin on Apr 22, 2017 16:56:50 GMT -5

kokenge Avatar
Since HTML can use single quotes or double quotes, I always use the single qoutes. Just looks a lot better. And stuff like align and width and height don't need quotes , I write it as follows:url2find$="http://libertybasic.com/"
html "<div id='IFR' ALIGN=CENTER><IFRAME SRC="+url2find$+" WIDTH=600 HEIGHT=400 ></div>"e

HTH .
Have a g'day.
BTY I'm in las vegas for the weekend.. and broke.. Help!

Great tip. Thanks Dan.

-Carl