UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Adding Rows To Smartframes Script    
 
   
josephbupe
post Sep 11 2014, 04:21 AM
Post#1



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Hi,
I am developing a web application which will be comprised of three columns: (1) Search form, (2) Image gallery, (3) Image details. The search form will display query results in the image gallery and any image clicked in the image gallery will display details in the third column. The site is going to be more like html framesets, but research reveals that framesets are not favourable due to many reasons. I however found an alternative called "smartframes" that I want to use instead of html framesets
Link: smartframes
Does anyone know how I can add ROWS (equivalent to Frameset Rows) so I can have header and footer?
Adding this line alone is not working for me:
CODE
document.write('<frameset rows="17%,*" frameborder="no">');

Original code is as follows:
CODE
<!--
/* SmartFrames - Author: Robert Darrell - http://www.ironspider.ca/ */
// Defines variables
// REPLACE menu.htm WITH YOUR MENU PAGE
// REPLACE page1.htm WITH YOUR INITIAL CONTENT PAGE
menuURL = "menu.htm";
contentURL = "page1.htm";
reloadURL = parent.document.URL;
orphanURL = reloadURL.substring(reloadURL.indexOf('?')+1, reloadURL.indexOf('&'));
frameName = reloadURL.substring(reloadURL.indexOf('&')+1, reloadURL.length);
// Reassigns variable according to frame name passed by orphan
if (frameName == "menu") {
menuURL = orphanURL;
} else if (frameName == "content") {
contentURL = orphanURL;
}
// Writes frameset
document.write('<frameset cols="25%,75%" frameborder="no">');
document.write('<frame src="' + menuURL + '" name="menu">');
document.write('<frame src="' + contentURL + '" name="content" marginheight="15" marginwidth="50" scrolling="yes">');
// -->
</script>
<!-- Use the noframes section to help search engines index your site -->
<noframes>THIS WEBSITE IS ABOUT...<br><br>
<a href="menu.htm">Site Menu</a>
</noframes>
</frameset>
Go to the top of the page
 
cheekybuddha
post Sep 11 2014, 04:30 AM
Post#2


UtterAccess VIP
Posts: 9,281
Joined: 6-December 03
From: Telegraph Hill


I've never really worked with framesets, but what happens if you try adjusting:
CODE
// ...
// Writes frameset
document.write('<frameset cols="25%,75%" rows="17%,*" frameborder="no">');
// ...

Provided the syntax is correct for setting the rows, I think that should work.
hth,
d
Go to the top of the page
 
josephbupe
post Sep 11 2014, 04:53 AM
Post#3



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Hi d,
Even if the row seems to be created, it appears at the bottom instead of the top of the page.
The same results I was getting with the first try. See attached screen-short.
Joseph
Attached File(s)
Attached File  screenshort.png ( 176.87K )Number of downloads: 4
 
Go to the top of the page
 
cheekybuddha
post Sep 11 2014, 05:14 AM
Post#4


UtterAccess VIP
Posts: 9,281
Joined: 6-December 03
From: Telegraph Hill


OK Joseph,
You are going to have to nest cleverly. Do you want to have the header and footer above and below the whole of what you have shown in your screenshot?
d
Go to the top of the page
 
josephbupe
post Sep 11 2014, 05:25 AM
Post#5



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Yes please.
Go to the top of the page
 
cheekybuddha
post Sep 11 2014, 05:26 AM
Post#6


UtterAccess VIP
Posts: 9,281
Joined: 6-December 03
From: Telegraph Hill


CODE
headerURL = "header.htm";
menuURL = "menu.htm";
contentURL = "page1.htm";
footerURL = "footer.htm";
reloadURL = parent.document.URL;
orphanURL = reloadURL.substring(reloadURL.indexOf('?')+1, reloadURL.indexOf('&'));
frameName = reloadURL.substring(reloadURL.indexOf('&')+1, reloadURL.length);
// Reassigns variable according to frame name passed by orphan
if (frameName == "menu") {
menuURL = orphanURL;
} else if (frameName == "content") {
contentURL = orphanURL;
}
// Writes framesets
document.write('<frameset rows="15%,*,15%" frameborder="no">');
document.write('  <frame src="' + headerURL + '" name="header">');
document.write('  <frameset cols="25%,75%" frameborder="no">');
document.write('    <frame src="' + menuURL + '" name="menu">');
document.write('    <frame src="' + contentURL + '" name="content" marginheight="15" marginwidth="50" scrolling="yes">');
document.write('  </frameset>');
document.write('  <frame src="' + footerURL + '" name="footer">');
document.write('</frameset>');

Try something like the above - BUT NOTE it doesn't take into account what is happening with the framename section.
(I added in header.htm and footer.htm as the SRC for the additional frames.)
But also note that framesets have been deprecated from HTML5.
hth,
d
Go to the top of the page
 
josephbupe
post Sep 11 2014, 05:48 AM
Post#7



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Now, the header of visible on top of the page. But the content (gallery.html) and footer are missing.
Go to the top of the page
 
cheekybuddha
post Sep 11 2014, 05:50 AM
Post#8


UtterAccess VIP
Posts: 9,281
Joined: 6-December 03
From: Telegraph Hill


Can you post a 'View Source'so we can see what html IE is receiving.
Go to the top of the page
 
josephbupe
post Sep 11 2014, 05:56 AM
Post#9



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Ok, I have this:
CODE
<html>
<head>
<title>Website Title Goes Here</title>
<META NAME="description" CONTENT="A brief description of your website goes here...">
<META NAME="keywords" CONTENT="A, comma-separated, list, of, keywords, and, key phrases, relevant to your website, content, goes here">
</head>
<script type="text/javascript">
<!--
/* SmartFrames - Author: Robert Darrell - http://www.ironspider.ca/ */
// Defines variables
// REPLACE menu.htm WITH YOUR MENU PAGE
// REPLACE page1.htm WITH YOUR INITIAL CONTENT PAGE
headerURL = "header.html";
searchURL = "search.html";
galleryURL = "gallery.html";
footerURL = "footer.html";
reloadURL = parent.document.URL;
orphanURL = reloadURL.substring(reloadURL.indexOf('?')+1, reloadURL.indexOf('&'));
frameName = reloadURL.substring(reloadURL.indexOf('&')+1, reloadURL.length);
// Reassigns variable according to frame name passed by orphan
if (frameName == "search") {
searchURL = orphanURL;
} else if (frameName == "gallery") {
galleryURL = orphanURL;
}
// Writes frameset
document.write('<frameset rows="15%,*,15%" frameborder="no">');
document.write('  <frame src="' + headerURL + '" name="header">');
document.write('  <frameset cols="25%,75%" frameborder="no">');
document.write('    <frame src="' + searchURL + '" name="search">');
document.write('    <frame src="' + contentURL + '" name="gallery" marginheight="15" marginwidth="50" scrolling="yes">');
document.write('  </frameset>');
document.write('  <frame src="' + footerURL + '" name="footer">');
document.write('</frameset>');
// -->
</script>
<!-- Use the noframes section to help search engines index your site -->
<noframes>THIS WEBSITE IS ABOUT...<br><br>
<a href="search.html">Site Menu</a>
</noframes>
</frameset>
</html>
Go to the top of the page
 
josephbupe
post Sep 11 2014, 05:59 AM
Post#10



Posts: 781
Joined: 23-January 08
From: Lusaka,Zambia


Pardon me please, It was my fault.
All is fine now and thanx alot for staying with me on this one.
Warm regards.
Joseph uarulez2.gif
Go to the top of the page
 
cheekybuddha
post Sep 11 2014, 06:02 AM
Post#11


UtterAccess VIP
Posts: 9,281
Joined: 6-December 03
From: Telegraph Hill


Cool! Glad you got it working!
thumbup.gif
d
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th December 2017 - 02:42 PM