JavaScript - Help Removing Null Iframes :(
Hi,
I'm trying to build this grease monkey script, which runs on all pages, and simply deletes all iframes that have no content loaded in them. I have a hosts file with many ad servers which are blocked. This leaves ugly holes in the page and I am trying to remove these empty iframes. Plz help Similar TutorialsHi i have done some reading on the net today because i am getting an error on ie. I did find the javascript twice in my code, once in the header and once here, so i removed it from the header. I also changed to src to the full url. But i am still getting this and i dont know why. the file is located in the root directory. Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SearchToolbar 1.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; msn OptimizedIE8;ENUS) Timestamp: Sat, 30 Jul 2011 16:03:05 UTC Message: 'null' is null or not an object Line: 8 Char: 3894 Code: 0 URI: http://www.mysite.com/swfobject.js Code: <script type='text/javascript' src='$CONST_LINK_ROOT/swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv'); s1.write('preview'); </script> <embed src='$CONST_LINK_ROOT/flvplayer.swf?file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv&autoStart=false' width='175' height='175' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed> would appreciate any suggestions thanks. i was on 1.5 swfobject i did download 2.2 and im guessing all you do is replace the swfobject.js file to upgrade it, but what happened is it gives me this now. Code: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SearchToolbar 1.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; msn OptimizedIE8;ENUS) Timestamp: Sat, 30 Jul 2011 16:31:08 UTC Message: 'SWFObject' is undefined Line: 1283 Char: 1 Code: 0 URI: http://www.mysite/video_admin.php?type=v i dont mind going back to the old version i just need to get this working and im soooooooo lost lol ok another update, this is becomming maddening lol. once i have this line in the header php Code: <script type='text/javascript' src='$CONST_LINK_ROOT/swfobject.js'></script> I never have to use it again as long as they header php is included correct? This is what is driving me nuts, im back on 1.5 and it says its undefined Code: but am in not defining it on this line? ---> var s1 = new SWFObject('player.swf','player','400','300','9'); <script type='text/javascript' src='swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=$CONST_LINK_ROOT/movies/$sql_array->vid_id.flv'); s1.write('preview'); </script> Another Update. I am back to the original question. null is null or not an object.. in my search i have found this found a solution. basically Internet Explorer is crappy and doesnt like the setAttribute property so had to change the onchange handler by directly changing the attrbute for the object like so. object.onchange = function() {} i have no idea what they means, does that mean i need to change swfobject.js or does that mean i have to change my xml request. and if it is the swfobject i have no clue what they mean or what lines Hi I am having trouble with a script. I cannot figure out why I get the message: error: null is null or not an object (In IE8) The site is: www.rayburns.com I have check the javascript for the navigation bar and for the rotating images and cannot see what is missing. Not sure what is not being called. Can someone please help with this. Thank you in advance! Hi I've implemented Busybox on a website to display FLV files in a popup player. This works fine, except for the following error in IE (FF is fine) when I close the popup: 'null' is null or not an object I think I've narrowed it down to the following block of code, but am stuck as to what to do from here. Code: var cl = new Element('img',{ 'styles':{ width:'24px', height:'24px', position:'absolute', top:'-20px', right:'-20px', 'z-index':'100000' }, 'src':'bumpbox/closed.png', 'id':'closer' }) cl.addEvent('click',function(e){ e = new Event(e).stop(); bg.dispose(); $(el).getChildren().dispose(); eff2.start({ 'width':[maxw,1], 'height':[maxh,1], 'left': [endleft,middleH], 'top': [endtop, middleV+s] }) }) The IE error is just giving me line number 1 of the php, but the error, I'm sure, lays in the Javascript. Many thanks Hi, Ive written some code to try and resize a page dependant on the content oof an iframe. Code is as follows: Code: window.onload=sizeAdj(); function sizeAdj() { var elFrame = document.getElementById('theFrame'); var elTable = document.getElementById('tableGrab'); var elDivMain = document.getElementById('main'); var elDivWrapper = document.getElementById('wrapper'); var the_height = elFrame.contentWindow.document.body; elFrame.height = the_height; elTable.height = the_height + 90; elDivMain.height = the_height + 90; elDivWrapper.height = the_height + 465; } I originally thought that I would just be able to resize the iframe and the other elements would follow suit but as you can see Ive tried to resize the other encasing elements also. The code resizes partially in chrome but only to a certain point and not to the full height of the doc content. Help greatly appreciated - full source content attached. Rugby Glass.zip Thanks Sol Hi there, I need a little help with a script I am using for a link on my index page to load up a different page with two iFrames on it and at the same time load up different pages in each of these iFrames. I have achieved this with only one iFrame so far with this script: Code: 1. <script type="text/javascript"> 2. <!-- 3. 4. function loadIframe(){ 5. if (location.search.length > 0){ 6. url = unescape(location.search.substring(1)) 7. 8. window.frames["main"].location=url 9. } 10. } 11. 12. onload=loadIframe 13. //--> 14. </script> 15. 16. <a href="mainpage.html?about.htm"</a> So basically when I click on Link1 on Page1 it takes me to Page2 with iFrame1 with a page loaded and iFrame2 with nothing loaded whereas I would like Link1 on Page1 to load up Page 2 with two different pages loaded in the iFrames all at the same time. Any help would be appreciated thanks. Hey everyone! I used to use iframes to load external content without resetting the parent page. After reading the disadvantage of iframes, I've been looking for alternatives. I Googled and found different solutions, however with a problem: what I found are all scripts that require Java, meaning my design would be rendered useless in a java-disabled browser. So is there a safe method I can use, one allowing me to have navigation tabs on a single page that loads content into a div/or any kind of alternative to an iframe (without resetting the page) ? Thanks in advance. Nat Im looking to make the button in openWin2 (the cat pic) should close openWin1 (the bird pic)...also need to change the background color of openWin2...Any help would be appreciated. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DND HTML 4.01//EN" "http:www.w3.org/TR//html4/strict.dtd"> <html> <head> <title>TEST</title> <script type="text/javascript" src="http://code.jquery.com/jquery- latest.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#openWin1').click(function() { myWin1 = open('','','width=350,height=350'); var html = '<h3>Bird</h3>'; html += '<img src="bird.png"><br />'; myWin1.document.write(html); }); $('#openWin2').click(function() { var myWin2 = open('','win2','height=350,width=350'); var html = '<h3>Cat</h3>'; html += '<img src="cat.png"><br />'; html += '<button onclick="opener.openWin1.close();">Close</button>'; myWin2.document.write(html) ;}) ;}); </script> </head> <body> <p> <input type="button" id="openWin1" value="Display a bird" onclick="openWin1()" /> </p> <p> <a href id="openWin2" onclick="openWin2()">Display a cat</a> </p> </body> </html> Hi all I'm new to JavaScript and i have hit a slight problem with a project. basically, my issue is with iFrames - in particular, passing a value from an iframe to the parent page. i am trying to find a way for to pass the url of an iframe source back to the parent. hardcoding the source, or using a form within the iframe works fine - however i want to be able to view any page on the web within the frame, and for the parent page to be able to identify what url is being loaded within it. does anyone know of a solution? kind regards Neil Hello everyone,i will try to exaplain you what i am trying to do: I am building a web site in html5 and right now i am working in drag n drop some images from one iframe to another.Until now everything worked great.Today i connected my first iframe with my database so all the pictures are taken from there.For this reason, in my code, i create several <div>,each one with id>=1. My code for this is the following: Code: echo "<div class=\"drag\" id=\"".$info['id']."\" draggable=\"true\"><img src=\"postImages/".$info['id'].".jpg\" class=\"post\"></div>"; Its in php,but my results from chrome are the following: Code: <div class="drag" id="2" draggable="true"><img src="postImages/2.jpg" class="post"></div><<div class="drag" id="1" draggable="true"><img src="postImages/1.jpg" class="post"></div><div class="drag" id="3" draggable="true"><img src="postImages/3.jpg" class="post"></div><div class="drag" id="4" draggable="true"><img src="postImages/4.jpg" class="post"></div> So,so far i created several <div>s with one class "drag" and different ids starting from 1 until 4. And here start my problems!I have to change my code for the drag and drop functions in javascript in order to create a specific array with objects with id the <div> id.In more details,my code so far: Code: var people = { Seth : { blog : "http://google.com", photo: "postImages/1.jpg" } Seth2 : { blog : "http://google.com", photo: "postImages/2.jpg" } }; What i want is the SECOND iframe to create an array named people,but insead of Seth and Seth2 the objects inside to have ids 1,2,3... from my <div>s from the previous iframe. I am trying so many hours for this one (it is obvious that my javascript skills are not that good..) that i dont know what to do..i would be glad if you could help me! Thanks in advance! I apologise if this is in the wrong section. I have built a website using iframes at: http://www.krillmeed.com/ but when clicking through the menu, the address bar still stays at http://www.krillmeed.com/ no matter which page is loaded into the iframe. I have seen a number of javascripts around that can change this, but most do not seem to work anymore. Has anyone a sure way to correct this please
I am trying to get around using server side scripting for an issue on a webpage. I have a basic html form like this: Code: <html> <body> <FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR> <INPUT TYPE="text" NAME="inputbox" VALUE=""><P> <INPUT TYPE="button" NAME="button" Value="Click" onClick="testResult (this.form)"> </body> </html> I know I can use JavaScript to capture the data like this: Code: function testResults (form) { var TestVar = form.inputbox.value; alert ("You typed: " + TestVar); } Instead of alerting it, can I save the data in an iframe? Will it stay there once they leave the page? I want the iframe to eventually contain info from lots of people's answers. I am wanting to simulate saving the answers to a text file on the server. i have a archive of data that i want to be loaded in iframes since i have reached a length limit within that page. so what i have is a script that put in a value into a text area, but now i am trying to convert it to putting an src value inside an i frame. i am not the best with javascript so any help would be great. Code: <script type="text/javascript"> function ddl_changed(obj) { var pr = prim.options[prim.selectedIndex].value; var s1 = document.getElementById('s1'); s1.src = pr; } </script> body <div class="prim" align="center"> Database <select id="prim" onchange="ddl_changed(this)"> <option value=" ">Choose a data set</option> <option value="/ds2">data set 1</option> <option value="/ds3">data set 2</option> </select> </div> <iframe name="s1" id="s1" src=" "><p id="noframe">Your browser does not support frames</p> </iframe> thanks I have both the java script and the php files, i just need to intergrate them into eachother to display the different topics and forums: New Forum: index.php : PHP Code: <?php include('../includes/db_connect.php'); include('../includes/inc-logincheck.php'); include('../includes/inc-functions.php'); include('../includes/inc-userfunctions.php'); include('../includes/inc-menu.php'); //include('../includes/smile.php'); $strTitle='Forum'; $strMessage=''; $intUserID=$_SESSION['uID']; $fetch=$user; ////include('../includes/forumhead.php'); $forum=$_GET['forum']; $viewtopic = $_GET['viewtopic']; if ($crew == "0"){ $query="SELECT * FROM `topics` WHERE `forum`='$forum'"; } $query=mysql_query("$query"); $num=mysql_num_rows($query); $col="0"; while($fo=mysql_fetch_object($query)){ if ($col=="0"){ $td="#444444"; $col="1"; }else{ $td="#555555"; $col="0"; } $hehe=mysql_num_rows(mysql_query("SELECT * FROM replys WHERE idto='$fo->id'")); } ?> <link rel="stylesheet" type="text/css" href="../includes/forum.css"> <td width="99%" background="../game/site/site/innerbg.gif" bgcolor="#222222" valign="top"> <br> <center> <table border="0" cellspacing="0" cellpadding="10" width="100%" class="cat"> <tr> <td> <script language='JavaScript' type='text/javascript' src='../includes/scripts/autosize.js'></script> <script> var box = 'reply'; var oldTopic = 5; var muted = 'no'; var set = 0; function parseUrl(url,variable){ var theurl = url.split('?'); if(theurl[1]){ pars = theurl[1].split('&'); for(i = 0; i < pars.length; i++){ var check = pars[i].split('='); if(check[0] == variable){ return check[1]; } } } return false; } function keepRefreshed(){ if(set == 0){ refresher = setTimeout("keepRefreshed()", 60000); allowButton = setTimeout("allowRefresh()", 3000); set = 1; } else { refreshTopics(); } } function allowRefresh(){ document.replyForm.refreshButton.disabled = false; } function refreshTopics(hl){ if(set == 1){ clearTimeout(refresher); clearTimeout(allowButton); } document.replyForm.refreshButton.disabled = true; refresher = setTimeout("keepRefreshed()", 60000); allowButton = setTimeout("allowRefresh()", 3000); if(document.replyForm.editIt.value == 'x'){ currentTopics = self.frames['topicsFrame'].location.href; var page = parseUrl(currentTopics, 'page'); var forum = parseUrl(currentTopics, 'forum'); var flag = parseUrl(currentTopics, 'flag'); if(flag){ add = '&flag=' + flag; } else { add = ''; } if(!page){ page = 1; } if(!forum){ forum = 1; } if(!hl){ hl = oldTopic; } self.frames['topicsFrame'].location.href = 'topics.php?forum=' + forum + '&default=' + oldTopic + '&page=' + page + '&hl=' + hl + add; } } function updateBox(id){ oldTopic = id; if(document.replyForm.editIt.value != 'x'){ document.replyForm.editIt.value = 'x'; document.replyForm.topicSubject.disabled = false; document.replyForm.selectedFlag.disabled = false; document.replyForm.submitTitle.value = 'Add!'; switchBox(true); } else { if(box == 'reply'){ document.replyForm.replyTo.value = id; document.replyForm.action = 'view.php?id=' + id + '&forum=' + 1; } } } function emotion(em){ document.replyForm.replyMes.value = document.replyForm.replyMes.value + em; document.replyForm.replyMes.scrollTop = document.replyForm.replyMes.scrollHeight; } function editThread(id, flag, points){ mes = self.frames['repliesFrame'].document.getElementById('topicMessage').value; sub = self.frames['repliesFrame'].document.getElementById('topicSubject').innerHTML; var replyform = document.replyForm; if(box == 'reply'){ switchBox(); } document.getElementById('topHeader').innerHTML = 'Edit thread'; replyform.topicSubject.value = sub; replyform.topicSubject.disabled = true; replyform.replyMes.value = mes; replyform.replyMes.focus(); replyform.editIt.value = id; replyform.selectedFlag.value = flag; replyform.selectedFlag.disabled = true; checkPoints(); replyform.addPoints.value = points; replyform.submitTitle.value = 'Edit!'; } function addQuote(type, username, id){ if(type == 'topic'){ quote = self.frames['repliesFrame'].document.getElementById('topicMessage'); } else { quote = self.frames['repliesFrame'].document.getElementById('quote_' + id); } format = '[quote=' + username + ']' + quote.innerHTML + '[/quote]\n\n'; document.replyForm.replyMes.value = document.replyForm.replyMes.value + format; document.replyForm.replyMes.scrollTop = 0; document.replyForm.replyMes.scrollTop = document.replyForm.replyMes.scrollHeight; } function switchBox(c,k){ if(document.replyForm.editIt.value != 'x'){ updateBox(oldTopic); return; } if((box == 'reply') && (!k)){ document.replyForm.action = 'topics.php?forum=1'; document.replyForm.target = 'topicsFrame'; document.replyForm.replyTo.value = 'x'; document.getElementById('topHeader').innerHTML = 'New topic'; document.getElementById('title').innerHTML = 'Add reply'; document.getElementById('topicTitle').style.display = 'block'; if(1 == 1){ document.getElementById('flagBox').style.display = 'block'; } box = 'topic'; } else { if(c){ document.replyForm.topicSubject.value = ''; document.replyForm.replyMes.value = ''; document.replyForm.addPoints.value = ''; document.replyForm.selectedFlag.value = 1; if(k){ url = 'topics.php?forum=1&hl=' + k; if(1 == 1){ if(document.replyForm.forumFilter.value){ url = url + '&flag=' + document.replyForm.forumFilter.value; } } self.frames['topicsFrame'].location.href = url; } } document.replyForm.action = 'view.php?id=' + oldTopic + '&forum=' + 1; document.replyForm.target = 'repliesFrame'; document.replyForm.replyTo.value = oldTopic; document.getElementById('topHeader').innerHTML = 'Add reply'; document.getElementById('title').innerHTML = 'Add topic'; document.getElementById('topicTitle').style.display = 'none'; document.getElementById('flagBox').style.display = 'none'; document.getElementById('addPoints').style.display = 'none'; box = 'reply'; } if(box == 'reply'){ updateButton(false); } else { checkPoints(); updateButton(true); } } function displayError(message){ if(message == 'clear'){ switchBox(true); document.getElementById('forumError').style.display = 'none'; document.getElementById('forumError').innerHTML = ''; } else { document.getElementById('forumError').style.display = 'block'; document.getElementById('forumError').innerHTML = message; } } var timel = 0; function countdown(){ timel -= 1; if(timel <= 0){ unMute(); } else { minutes = Math.floor(timel / 60); seconds = timel - (minutes * 60); document.getElementById('timeleft').innerHTML = '<b>Time left:</b> ' + minutes + ' minutes ' + seconds + ' seconds'; setTimeout("countdown()", 1000); } } function mutePlayer(muter, reason, post, timeleft){ muted = 'yes'; timel = timeleft; minutes = Math.floor(timeleft / 60); seconds = timeleft - (minutes * 60); document.getElementById('muteBox').innerHTML = 'You are unable to post because you have been muted by: <a href="viewprofile.php?viewuser=' + muter + '">' + muter + '</a><br><br><b>Reason:</b> ' + reason + '<br><div id="timeleft"><b>Time left:</b> ' + minutes + ' minutes ' + seconds + ' seconds</div><b>Post:</b><br>' + post; document.getElementById('replyBox').style.display = 'none'; document.getElementById('muteBox').style.display = 'block'; setTimeout("countdown()", 1000); } function unMute(){ muted = 'no'; document.getElementById('replyBox').style.display = 'block'; document.getElementById('muteBox').style.display = 'none'; } function checkPoints(){ var flag = document.replyForm.selectedFlag; if(flag.value == 13){ document.getElementById('addPoints').style.display = 'block'; } else { document.getElementById('addPoints').style.display = 'none'; } if(flag.value <= 3){ updateButton(true); } else { updateButton(false); } } function updateButton(upto){ if(1 == 1){ var button = document.replyForm.submitTitle; var flag = document.replyForm.selectedFlag; if((upto) && (flag.value <= 3)){ button.disabled = true; } else { button.disabled = false; } } } function updateFilter(){ var flag = document.replyForm.forumFilter.value; if(flag != 'void'){ url = 'topics.php?forum=1'; if(flag != 'all'){ url += '&flag=' + flag; } self.frames['topicsFrame'].location.href = url; } } function watchThread(){ url = 'topics.php?forum=1&hl=' + oldTopic + '&watch=' + oldTopic; if(document.replyForm.forumFilter.value){ url = url + '&flag=' + document.replyForm.forumFilter.value; } self.frames['topicsFrame'].location.href = url; } </script> <div id="forumError" display="none"></div> <center> <table border=0 cellspacing=0 cellpadding=2 width=99% bordercolor=black> <tr> <td width=40% valign=top class="insideTables"> <form name="replyForm" method="post" target="repliesFrame" action="view.php?id=5&forum=1"> <table border=1 cellspacing=0 cellpadding=2 width=100% class=sub2 bordercolor=black> <tr> <td align=center class=header><div id="topHeader">Add reply</div></td> </tr> <tr> <td> <div id="replyBox"> <div style="display:none;" id="topicTitle">Subject: <input type=text style="width:100%" name="topicSubject" maxlength=35><br>Message:<br></div> <textarea style="width:100%" rows=5 name="replyMes" style="white-space: normal;"></textarea> <div style="display:none;" id="flagBox"> <select style="width:100%;" name="selectedFlag" onChange="javascript:checkPoints()"><option selected value="1" style="background-color:#CDCDCD;">--- GAME RELATED ---</option> <option value="4" style="background-color:#69A16C;">Questions/Help</option> <option value="5" style="background-color:#69A16C;">Feature Discussion</option> <option value="6" style="background-color:#69A16C;">RIP/WS</option> <option value="7" style="background-color:#69A16C;">Bust Party</option> <option value="8" style="background-color:#69A16C;">Promotions</option> <option value="22" style="background-color:#69A16C;">Other</option> <option value="2" style="background-color:#CDCDCD;">--- OFF TOPIC ---</option> <option value="9" style="background-color:#CCAB6B;">Contests & Games</option> <option value="10" style="background-color:#CCAB6B;">Bars</option> <option value="11" style="background-color:#CCAB6B;">Rate THIS</option> <option value="21" style="background-color:#CCAB6B;">Sports</option> <option value="23" style="background-color:#CCAB6B;">Movies, Music & TV</option> <option value="24" style="background-color:#CCAB6B;">Other</option> <option value="3" style="background-color:#CDCDCD;">--- CLASSIFIEDS ---</option> <option value="13" style="background-color:#6B9FCC;">Points</option> <option value="14" style="background-color:#6B9FCC;">Crew</option> <option value="15" style="background-color:#6B9FCC;">Pictures & Music</option> <option value="16" style="background-color:#6B9FCC;">Casino</option> <option value="17" style="background-color:#6B9FCC;">Protection</option> <option value="18" style="background-color:#6B9FCC;">Organized Crime</option> <option value="19" style="background-color:#6B9FCC;">Establishment</option> <option value="20" style="background-color:#6B9FCC;">Other</option> </select> </div> <div style="display:none;" id="addPoints"> Verify: <input type=text name="addPoints" size=5> </div> <br> <input type=hidden name="replyTo"> <input type=hidden name="editIt" value="x"> <center> <a onclick="emotion(' :arrow: ')" style="cursor: pointer;"><img src="../game/emotions/arrow.gif" border=0 alt=":arrow:"></a> <a onclick="emotion(' :D ')" style="cursor: pointer;"><img src="../game/emotions/biggrin.gif" border=0 alt=":D"></a> <a onclick="emotion(' :S ')" style="cursor: pointer;"><img src="../game/emotions/confused.gif" border=0 alt=":S"></a> <a onclick="emotion(' 8) ')" style="cursor: pointer;"><img src="../game/emotions/cool.gif" border=0 alt="8)"></a> <a onclick="emotion(' :\'( ')" style="cursor: pointer;"><img src="../game/emotions/cry.gif" border=0 alt=":'("></a> <a onclick="emotion(' 8| ')" style="cursor: pointer;"><img src="../game/emotions/eek.gif" border=0 alt="8|"></a> <a onclick="emotion(' :evil: ')" style="cursor: pointer;"><img src="../game/emotions/evil.gif" border=0 alt=":evil:"></a> <a onclick="emotion(' :!: ')" style="cursor: pointer;"><img src="../game/emotions/exclaim.gif" border=0 alt=":!:"></a> <a onclick="emotion(' :idea: ')" style="cursor: pointer;"><img src="../game/emotions/idea.gif" border=0 alt=":idea:"></a> <a onclick="emotion(' :lol: ')" style="cursor: pointer;"><img src="../game/emotions/lol.gif" border=0 alt=":lol:"></a> <a onclick="emotion(' :mad: ')" style="cursor: pointer;"><img src="../game/emotions/mad.gif" border=0 alt=":mad:"></a> <br> <a onclick="emotion(' :?: ')" style="cursor: pointer;"><img src="../game/emotions/question.gif" border=0 alt=":?:"></a> <a onclick="emotion(' :redface: ')" style="cursor: pointer;"><img src="../game/emotions/redface.gif" border=0 alt=":redface:"></a> <a onclick="emotion(' :rolleyes: ')" style="cursor: pointer;"><img src="../game/emotions/rolleyes.gif" border=0 alt=":rolleyes:"></a> <a onclick="emotion(' :( ')" style="cursor: pointer;"><img src="../game/emotions/sad.gif" border=0 alt=":("></a> <a onclick="emotion(' :) ')" style="cursor: pointer;"><img src="../game/emotions/smile.gif" border=0 alt=":)"></a> <a onclick="emotion(' :o ')" style="cursor: pointer;"><img src="../game/emotions/surprised.gif" border=0 alt=":o"></a> <a onclick="emotion(' :P ')" style="cursor: pointer;"><img src="../game/emotions/toungue.gif" border=0 alt=":P"></a> <a onclick="emotion(' :twisted: ')" style="cursor: pointer;"><img src="../game/emotions/twisted.gif" border=0 alt=":twisted:"></a> <a onclick="emotion(' ;) ')" style="cursor: pointer;"><img src="../game/emotions/wink.gif" border=0 alt=";)"></a> <a onclick="emotion(' :tdn: ')" style="cursor: pointer;"><img src="../game/emotions/tdown.gif" border=0 alt=":tdn:"></a> <a onclick="emotion(' :tup: ')" style="cursor: pointer;"><img src="../game/emotions/tup.gif" border=0 alt=":tup:"></a> <br> <input type=submit value="Add!" name="submitTitle"> <input type=button value="Watch!" onClick="javascript:watchThread()"> <input type=button value="Refresh!" name="refreshButton" onClick="javascript:refreshTopics()"> </center> </div> <div id="muteBox" style="display:none;"></div> </td> </tr> <tr> <td align=center class=header>Topics (<a href="javascript:switchBox()" id="title">Add topic</a>)</td> </tr> <tr> <td> <select style="width:100%;" onChange="javascript:updateFilter()" name="forumFilter"> <option value="void" style="background-color:#CDCDCD;"> FILTER</option> <option value="all">View all</option> <option selected value="1" style="background-color:#CDCDCD;">--- GAME RELATED ---</option> <option value="4" style="background-color:#69A16C;">Questions/Help</option> <option value="5" style="background-color:#69A16C;">Feature Discussion</option> <option value="6" style="background-color:#69A16C;">RIP/WS</option> <option value="7" style="background-color:#69A16C;">Bust Party</option> <option value="8" style="background-color:#69A16C;">Promotions</option> <option value="22" style="background-color:#69A16C;">Other</option> <option value="2" style="background-color:#CDCDCD;">--- OFF TOPIC ---</option> <option value="9" style="background-color:#CCAB6B;">Contests & Games</option> <option value="10" style="background-color:#CCAB6B;">Bars</option> <option value="11" style="background-color:#CCAB6B;">Rate THIS</option> <option value="21" style="background-color:#CCAB6B;">Sports</option> <option value="23" style="background-color:#CCAB6B;">Movies, Music & TV</option> <option value="24" style="background-color:#CCAB6B;">Other</option> <option value="3" style="background-color:#CDCDCD;">--- CLASSIFIEDS ---</option> <option value="13" style="background-color:#6B9FCC;">Points</option> <option value="14" style="background-color:#6B9FCC;">Crew</option> <option value="15" style="background-color:#6B9FCC;">Pictures & Music</option> <option value="16" style="background-color:#6B9FCC;">Casino</option> <option value="17" style="background-color:#6B9FCC;">Protection</option> <option value="18" style="background-color:#6B9FCC;">Organized Crime</option> <option value="19" style="background-color:#6B9FCC;">Establishment</option> <option value="20" style="background-color:#6B9FCC;">Other</option> </select> </td> </tr> <tr> <td> <iframe width=100% height="357" src="topics.php?forum=1&flag=<?php echo "$forum"; ?>" frameborder="0" allowTransparency="true" name="topicsFrame" id="topicsFrame"></iframe> </td> </tr> </table> </form> </td> <td width=60% valign=top> <iframe width=100% height="590" src="view.php?forum=1&id=<?php echo "$viewtopic"; ?>" frameborder="0" id="repliesFrame" name="repliesFrame" allowTransparency="true"></iframe> </td> </tr> </table> </td> </tr> </table> </td> <?php include("/home/tacticsc/domains/360-tactics.co.uk/public_html/crimewave/includes/inc-footer.php"); ?> i will post the rest of the codes in comments below due to too many word count. if its not to hard please help me, i have put all the Javascript there and the php it just needs to be implimented, i have started some of it, such as getting the topics to display like so: its just when you click the topic it doesnt load into the right hand iframe and some other things like the reply box ect thanks. Dan Hi everyone, I run a streaming site and am looking to have the option on a chat room next to the stream. Not everyone likes having the chat facility so I'd like to make it optional. As the page loads I'd like the content to look like the diagram below with the stream (iframe1) taking up 95% of the page and the other 5% being taken up by an image which will say "open chat". The chat (iframe2) would have a width of 0%. Then when the "open chat" image is clicked I'd like the chat (iframe2) to become 35% and the stream (iframe1) to become 60%. If someone could make a nice sliding effect when the image is clicked that'd be even better. Here's a diagram to show what it'd look like with the resized iframes. If anyone can help me out and get this working to a good standard there will be a small paypal gift on offer . Cheers, Ben I've been trying to get a form to control iframes, but new to javascript I basically want to input the url from a form & display it in an iframe, but cant figure out how to link the url from the form to the iframe The code im using atm Code: <html> <head> <title> SearchLite v2 - search multiple sites at once</title> <STYLE TYPE="text/css"> .txt { BACKGROUND-COLOR: lavender; BORDER-BOTTOM-COLOR: lavender; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-COLOR: lavender; BORDER-LEFT-WIDTH: 0px; BORDER-RIGHT-COLOR: lavender; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-COLOR: lavender; BORDER-TOP-WIDTH: 0px; HEIGHT: 22px; WIDTH: 599px; } .cellht { HEIGHT: 50px; } .cell { BACKGROUND-COLOR: lavender; } </STYLE> <script> function win() { frmlen = document.myform.elements.length; idiv=1; for (var icnt=0;icnt<frmlen;icnt++) { //loop thru all FORM elements and look for checkboxes which have been checked if (document.myform.elements[icnt].type=="checkbox" && document.myform.elements[icnt].checked) { //make IFRAME visible document.getElementById("f"+idiv).style.visibility = 'visible'; //make textbox that shows heading with name of site being searched, visible document.getElementById("t"+idiv).style.visibility = 'visible'; //build the URL strSite = document.myform.elements[icnt].value; strSearch= escape(document.myform.mytext.value); url = strSite + strSearch; //set SRC property of IFRAME to dynamically built URL document.getElementById("f"+idiv).src = url; //show only the domain name part of the URL dmn=url.substring(7); document.getElementById("t"+idiv).value= dmn.substring(0,dmn.indexOf("/")); idiv+=1; } } } function hide() { for (var icnt=1;icnt<13;icnt++) { //hide all IFRAME s document.getElementById("f"+icnt).style.visibility = 'hidden'; //hide all the camouflaged textboxes that display the title document.getElementById("t"+icnt).style.visibility = 'hidden'; } } </script> </head> //Form1 i want to use for the url ........... <form> Enter URL1: <input type="text" name="Enter Url" /> </form> //Form2 i want to use for the url ........... <form> Enter URL2: <input type="text" name="Enter Url" /> </form> <body onload="hide()"> <form method=post action="" name="myform"> <table border=0 align='center'> <tr><td colspan=3 height='30%'><font size="5">SEARCH</font><i><font size="5" color="blue">LITE</font></i> v2 -search multiple sites at once and view results on a single page </td><td colspan=2> </td></tr> <tr > <td COLSPAN=3 ><input type="text" name="mytext" size="55"></td> <td COLSPAN=3><input type="button" value="Find" onClick="win()"> <input type="reset" value="Reset" onclick="hide()"> <a href="mailto:dotnut@hotmail.com">Feedback</a></td> </tr> <tr > //Want to change the value= replaced by the value in the form <td class="cell"><input type="checkbox" name="1" value="http://www.google.com/search?hl=en&btnG=Google+Search&q=">Google</td> <td class="cell"><input type="checkbox" name="2" value="http://www.dictionary.com/search?q=">Dictionary</td> <tr><td COLSPAN=5 HEIGHT='50' CLASS='cellht'><input type='text' id='t1' class='txt'></td></tr> <tr><td COLSPAN=5><IFRAME id='f1' FRAMEBORDER=1 SCROLLING='yes' WIDTH=600 HEIGHT=360></IFRAME><br></td></tr> <tr><td COLSPAN=5 CLASS='cellht'><input type='text' id='t2' class='txt' ></td></tr> <tr><td COLSPAN=5><IFRAME id='f2' FRAMEBORDER=1 SCROLLING='yes' WIDTH=600 HEIGHT=360></IFRAME><br></td></tr> </table> </form> </body> </html> thnx Hi all, I have a fairly tricky problem: I have an XML feed of some products from a shop. Is there any way to make it so that if a link to 'product 1' (product_id=0001) is clicked then a div appears elsewhere on the page displaying information about that product from the XML feed (eg stock level and price of 0001). However, when a link to 'product 2' (product_id=0002) is clicked then then the information in this div is that of product 2. (ie: not opening a new div elsewhere or over the top of the old one for product 2's info, but actually in the original div, replacing product 1's info. I guess AJAX is the best method?) The reason i want to do this is so that the info displayed in the div is dependant on the link that has been clicked. I will have links to up to a few hundred products on the page so this method would keep the script size and loading times down - not to mention the enormous amount of work of manually coding a new div for each product. In fact... to make it even more complicated i actually want the links themselves (‘product 1’, ‘product 2’ etc…) to be in an iframe but the div to be opened on the parent page... perhaps its best to tackle on thing at a time though! The XML looks like: Code: <Products> <Product> <Main_Category_id>1</Main_Category_id> <Main_Category_Name>products</Main_Category_Name> <Sub_Category_1_id>12</Sub_Category_1_id> <Sub_Category_1_Name>products sub-category</Sub_Category_1_Name> <Product_id>0001</Product_id> <Product_Model>abcde</Product_Model> <Product_Name>Product 0001</Product_Name> <Product_Description> Description of product 1 </Product_Description> <Product_Price>5.00</Product_Price> <Product_Price_Special>0.00</Product_Price_Special> <Product_Currency>GBP</Product_Currency> <Product_Vat_Rate>0</Product_Vat_Rate> <Product_Image>0001</Product_Image> <Product_Image_Url> http://www.mysite.com/0001.jpg </Product_Image_Url> <Product_Quantity>9999</Product_Quantity> <Product_Weight>0.12</Product_Weight> <Product_Status>1</Product_Status> <Product_Manufacturer/> <Product_Last_Modified/> <Product_Date_Available/> </Product> <Product> <Main_Category_id>1</Main_Category_id> <Main_Category_Name>products</Main_Category_Name> <Sub_Category_1_id>12</Sub_Category_1_id> <Sub_Category_1_Name>products sub-category</Sub_Category_1_Name> <Product_id>0002</Product_id> <Product_Model>abcde</Product_Model> <Product_Name>Product 0002</Product_Name> <Product_Description> Description of product 2 </Product_Description> <Product_Price>10.00</Product_Price> <Product_Price_Special>0.00</Product_Price_Special> <Product_Currency>GBP</Product_Currency> <Product_Vat_Rate>0</Product_Vat_Rate> <Product_Image>0002</Product_Image> <Product_Image_Url> http://www.mysite.com/0002.jpg </Product_Image_Url> <Product_Quantity>9999</Product_Quantity> <Product_Weight>0.12</Product_Weight> <Product_Status>1</Product_Status> <Product_Manufacturer/> <Product_Last_Modified/> <Product_Date_Available/> </Product> Etc… </Products> Thanks for any help at all Matt Is it possible to add an onclick event to an iframe or perhaps a DIV that holds an iframe? In specific I am using the Facebook Open Graph like button: Code: <iframe src="http://www.facebook.com/plugins/like.php?layout=button_count&show_faces=true&width=450&action=like&colorscheme=light&href=http://urltoshare.com/" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:21px"></iframe> What I would like to do is add a simple onclick event to it so that I can run a process when the user clicks on it, at the moment I am just trying alert but cannot get it to work. By setting the iframe within a DIV with height/width specs set would an onclick event work within the DIV? I wish to have 3 frames left to right, an them to resize as i hover over each frame to specific percentage widths. mouseout would be 40,20,40 mouseover frame 1 80,10,10 mouseover frame 2 30,40,30 mouseover frame 3 10,10,80. I've been tring with iframes but no luck. i've been trying to build upon this, but to no avail. Code: <html lang="en"> <head> <title>iframes</title> </head> <body> <center><div id="container"> <iframe id="skin" src="skin.htm" style="width:35%;margin:0">a</iframe> <iframe id="ifr2" style="width:20%;margin:0">b</iframe> <iframe id="scalp" style="width:35%;margin:0">c</iframe> </div><center/> <script> var dv = document.getElementById('container'), skin = document.getElementById('skin'), ifr2 = document.getElementById('ifr2'); scalp = document.getElementById('scalp'); swapWidth = function(id){ if(id === 'skin'){ skin.style.width = '80%'; ifr2.style.width = '10%'; scalp.style.width = '10%'; }else if(id === 'scalp') { skin.style.width = '10%'; ifr2.style.width = '10%'; scalp.style.width = '80%'; }else if(id === 'ifr2') { skin.style.width = '30%'; ifr2.style.width = '40%'; scalp.style.width = '30%'; }else { skin.style.width = '40%'; ifr2.style.width = '20%'; scalp.style.width = '40%'; } }; dv.onmouseover = function(ev){ ev = ev || window.event; var elm = ev.target || ev.srcElement; swapWidth(elm.id); }; </script> </body> </html> plz help. Hi, ok i been playing around with this for awhile now http://www.dynamicdrive.com/dynamici...iframessi2.htm could not get it to work, so i tried several others and still nada, i finally ran across http://www.codingforums.com/archive/.../t-224293.html and i worked with what old pendent had done. The result is that i got some good results, closer to what i wanted but i need to do it multiple times. It works for one but not the other. i thought about putting each iframe on a sep html page and then using two sep tables and doing a SS include. but there has to be a better way. what im doing is i have an amazon iframe and a shopzilla iframe for the same product search and i want them posted one under the other iframe iframe and expand as the size needs, alowing for either to be longer or shorter when needed. i can do one but i have not found a way to do both yet. i removed my code because it showed my personal affiliate info in the code, since i cant give you an example without showing the code i guess ill just use the auto scroll and live with it... thanks |