|
-
Nov 26th, 2001, 03:56 PM
#1
Thread Starter
Frenzied Member
Whats wrong w/this outer html?
I am using hidden frames and outer html to display some items from a database and have done so sucessfully in the past. I am displaying a row of names down a sidebar but only have room for 7 so if I have more than that I am adding a "more names" link at the bottom like this:
·Michael
·Ralph
·john
·barbara
·Pat
·Archie
·Jughead
more names 1 [2] [3]
I have made [2] & [3] javascript links like this:
<div id="block_MoreNames" align="left">More Names: 1 <a href="javascript:sideChange('2')">[2]</a></div>
that calls this function:
function sideChange(newVar){
window.open('name_change.asp?Mode=ChangeSide&name=' + newVar , 'DoStealth');
}
in that page I (via ASP) build this javacript code (whole 'DoStealth' page pasted here:
<html>
<body bgcolor="#666666" text="#ffffff">
<script>
with (parent.frames[2].document.all){
bullet1.outerhtml = '<div id="bullet1">·</div>';
block_name1.outerhtml = '<div id="block_name1" onClick="nameChange(\'8\')">George</div>';
bullet2.outerhtml = '<div id="bullet2">·</div>';
block_name2.outerhtml = '<div id="block_name2" onClick="nameChange(\'9\')">Dave</div>';
bullet3.outerhtml = '<div id="bullet3">·</div>';
block_name3.outerhtml = '<div id="block_name3" onClick="nameChange(\'10\')">Adam</div>';
bullet4.outerhtml = '<div id="bullet4">·</div>';
block_name4.outerhtml = '<div id="block_name4" onClick="nameChange(\'11\')">Nikki</div>';
bullet5.outerhtml = '<div id="bullet5">·</div>';
block_name5.outerhtml = '<div id="block_name5" onClick="nameChange(\'12\')">Shanna</div>';
}
</script>
</body>
</html>
But... it dosen't change anything... I am bewildered, unbemused, and just plain stuck. I use outer html extensivly throught the app and cannot see why this isnt working. (probably something really simple )
Thanks in advance,
Michael
-
Nov 27th, 2001, 05:47 AM
#2
Hyperactive Member
Try this !
Code:
<div id="block_MoreNames" align="left">More Names: 1 <a href="java script:window.top.sideChange('2')">[2]</a></div>
//put this function in the page that contains the frames
function sideChange(newVar){
window.open('name_change.asp?Mode=ChangeSide&name=' + newVar , 'DoStealth');
}
<html>
<body bgcolor="#666666" text="#ffffff">
<script>
with (window.opener.parent.frames[2].document.all){
bullet1.outerhtml = '<div id="bullet1">·</div>';
block_name1.outerhtml = '<div id="block_name1" onClick="nameChange('8')">George</div>';
bullet2.outerhtml = '<div id="bullet2">·</div>';
block_name2.outerhtml = '<div id="block_name2" onClick="nameChange('9')">Dave</div>';
bullet3.outerhtml = '<div id="bullet3">·</div>';
block_name3.outerhtml = '<div id="block_name3" onClick="nameChange('10')">Adam</div>';
bullet4.outerhtml = '<div id="bullet4">·</div>';
block_name4.outerhtml = '<div id="block_name4" onClick="nameChange('11')">Nikki</div>';
bullet5.outerhtml = '<div id="bullet5">·</div>';
block_name5.outerhtml = '<div id="block_name5" onClick="nameChange('12')">Shanna</div>';
}
</script>
</body>
</html>
-
Nov 27th, 2001, 11:27 AM
#3
Thread Starter
Frenzied Member
moving the function woulden't change anything, the name_change.asp is still being opened in the frame. I tried throwing in a outer html call to another element on the page and that worked fine... so my guess is that it is in the names that I want to change from somehow.
this code is dynamicly built via asp:
<div id="bullet1">·</div>
<div id="block_name1" onClick="nameChange('1')">Mike</div>
<div id="bullet2">·</div>
<div id="block_name2" onClick="nameChange('2')">George</div>
<div id="bullet3">·</div>
<div id="block_name3" onClick="nameChange('3')">Ralph</div>
<div id="bullet4">·</div>
<div id="block_name4" onClick="nameChange('4')">Pat</div>
<div id="bullet5">·</div>
<div id="block_name5" onClick="nameChange('5')">Sam</div>
<div id="bullet6">·</div>
<div id="block_name6" onClick="nameChange('6')">Tasha</div>
<div id="bullet7">·</div>
<div id="block_name7" onClick="nameChange('7')">Earl</div>
<div id="block_Morenames" align="left">More names: 1 <a href="javascript:sideChange('2')">2</a></div>
thanks in advance,
Michael
-
Nov 27th, 2001, 11:30 AM
#4
Hyperactive Member
according to your post name_change.asp is being opened in a new window
function sideChange(newVar){
window.open('name_change.asp?Mode=ChangeSide&name=' + newVar , 'DoStealth');
}
-
Nov 27th, 2001, 11:32 AM
#5
Thread Starter
Frenzied Member
its a frame (frame4 in the array) called DoStealth that is hidden that I use for my outer html calls
michael
-
Nov 27th, 2001, 11:41 AM
#6
Hyperactive Member
ah I see now!
I read somewhere that the outerhtml method doesn't work until the whole page has loaded. try sticking it in an onload event eg!
Code:
<html>
<script>
function setDivs(){
with (parent.frames[2].document.all){
bullet1.outerhtml = '<div id="bullet1">·</div>';
block_name1.outerhtml = '<div id="block_name1" onClick="nameChange('8')">George</div>';
bullet2.outerhtml = '<div id="bullet2">·</div>';
block_name2.outerhtml = '<div id="block_name2" onClick="nameChange('9')">Dave</div>';
bullet3.outerhtml = '<div id="bullet3">·</div>';
block_name3.outerhtml = '<div id="block_name3" onClick="nameChange('10')">Adam</div>';
bullet4.outerhtml = '<div id="bullet4">·</div>';
block_name4.outerhtml = '<div id="block_name4" onClick="nameChange('11')">Nikki</div>';
bullet5.outerhtml = '<div id="bullet5">·</div>';
block_name5.outerhtml = '<div id="block_name5" onClick="nameChange('12')">Shanna</div>';
}
}
</script>
<body bgcolor="#666666" onload="setTimeout('setDivs()',100)" text="#ffffff">
</body>
</html>
I put it in a setTimeout just to make sure!
try that
-
Nov 27th, 2001, 12:02 PM
#7
Thread Starter
Frenzied Member
I'm angry and elated at the same time... you know what was wrong??? i had:
element.outerhtml
see the problem? nether do I... ready to be shocked?
the answer is.....
element.outerHTML
I spent a whole day on this...
thanks for all the help, sorry to waste your time 
Michael
-
Nov 27th, 2001, 12:08 PM
#8
Hyperactive Member
Don't you just hate it when that happens!
Don't worry your not alone in your anger and frustration it happens to us all!
Youv'e not wasted my time as I've learned something new anyway because I didn't know about outerHTML. I only knew about innerHTML.
Suerly this won't work in netscape though!
-
Nov 27th, 2001, 12:14 PM
#9
Thread Starter
Frenzied Member
I love outer html and use it all the time... my fav thing is to create a page with atleast two frames and have one set to 100% and the other to * (or any configuration... as long as one is hidden... at design time I set the % to 95 so I can see what is happening though) I just do all the processing in the 'dostealth' frame and never refresh the other. Outer html and tables don't get along to well though so you have to play with that abit. and no, I dont think Netscape supports it... not sure if they have their own version, but I am lucky enough to beable to program where I can tell my users "Use MSIE or else" 
thanks
michael
-
Nov 27th, 2001, 12:18 PM
#10
Hyperactive Member
Why can you tell your users to use MSIE or else?
-
Nov 27th, 2001, 12:22 PM
#11
Thread Starter
Frenzied Member
Because my boss lets me 
Apperantly the programmer before me convinced him that we can just do better apps that only work for msie so we just tell our clients to use our programs you must use msie
michael
-
Nov 27th, 2001, 12:24 PM
#12
Hyperactive Member
The guy before you was a clever guy..
So what is it you do?
-
Nov 27th, 2001, 12:28 PM
#13
Thread Starter
Frenzied Member
the actual business side I'm not all that clear on (don't care enough to learn, i just learn enough to know what my programs need to do) but I build ways for hotels to manage booking type stuff online... my latest projects are inhouse though like accounting software but internet based.
michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|