473,769 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pages Not rendering In Mozilla Help?

77 New Member
The following 3 pages which are popups on my site are not rendering in mozilla firefox. Source is visible instead. Any idea why?

http://herproom.5.forumer.com/index....e=post&id=9948

http://herproom.5.forumer.com/index....e=post&id=7101

http://herproom.5.forumer.com/index....e=post&id=9817
Nov 14 '07
27 2592
Inny
77 New Member
I want to send the url of a enlarged image to a new window on another server and display it there.

You want to force a new window to open and go to a certain webpage on a different server? Seems like a popup blocker would reject that, but you could try.
Apr 23 '08 #21
Plater
7,872 Recognized Expert Expert
So open a new window and give the url for the remote server in it?
Apr 23 '08 #22
Inny
77 New Member
I want to rewrite the code to display an enlarged image (from clickable thumbnail on my site) in a window on another site! (the url in the code below will be to a page on another site, different domain/server.

Expand|Select|Wrap|Line Numbers
  1. <body  onload=function(){document.getElementById("place_holder").src = window.opener.document.getElementById("imgurl").value; >
  2.  
  3. <script>
  4. function ResizeThem() {
  5. maxheight=250;
  6. maxwidth= 250;
  7. imgs=document.getElementsByTagName("img");
  8. for (p=0; p<imgs.length; p++) {
  9. if (imgs[p].getAttribute("alt")=="user posted image") {
  10. w=parseInt(imgs[p].width);
  11. h=parseInt(imgs[p].height);
  12. if (parseInt(imgs[p].width)>maxwidth) {
  13. imgs[p].style.cursor="pointer";
  14. imgs[p].setAttribute('alt','Reduced Image - Click to see full size');
  15. imgs[p].onclick=new Function("document.getElementById('imgurl').value = this.src; iw=window.open('http://inny.ipbfree.com/index.php?act=Attach&type=post&id=1342','ImageViewer','resizable=1,scrollbars=1')  ;iw.focus()");
  16. imgs[p].height=(maxwidth/imgs[p].width)*imgs[p].height;
  17. imgs[p].width=maxwidth;
  18. }
  19. if (parseInt(imgs[p].height)>maxheight) {
  20. imgs[p].style.cursor="pointer";
  21. imgs[p].onclick=new Function("document.getElementById('imgurl').value = this.src; iw=window.open('http://inny.ipbfree.com/index.php?act=Attach&type=post&id=1342','ImageViewer','resizable=1,scrollbars=1')  ;iw.focus()");
  22. imgs[p].width=(maxheight/imgs[p].height)*imgs[p].width;
  23. imgs[p].height=maxheight;
  24. }
  25. }
  26. }
  27. }
  28. ResizeThem();
  29. </script>
  30.  
  31.  
  32. <input type="hidden" id="imgurl">
  33.  
Apr 24 '08 #23
Inny
77 New Member
can I re-do the above code to open the enlarged image in a floating layer div instead?
Apr 25 '08 #24
acoder
16,027 Recognized Expert Moderator MVP
I want to rewrite the code to display an enlarged image (from clickable thumbnail on my site) in a window on another site! (the url in the code below will be to a page on another site, different domain/server.
As Plater, just change the URL to the new domain, but you won't be able to access elements on the page, or use window.opener to refer back to the parent window.
Apr 25 '08 #25
acoder
16,027 Recognized Expert Moderator MVP
can I re-do the above code to open the enlarged image in a floating layer div instead?
Yes, you can. Look for "lightbox" or one of its clones.
Apr 25 '08 #26
Inny
77 New Member
Yes but I dont want to have to set a specific attribute for each image manually,
I want my code to reduce the dimensions, and then instead of opening in a new window, it could assign the newly reduced image whatever attribute triggers the lightbox function, but i dont know to rewrite the code to do that. I need a functional example please.

For instance: I could Use This js..

Expand|Select|Wrap|Line Numbers
  1. /*
  2. See http://www.howtocreate.co.uk/perfectPopups.html and http://www.howtocreate.co.uk/jslibs/termsOfUse.html
  3. for details and terms of use.
  4. To call this script, use something like (the number is a delay before it closes or 0 for no timed closing -
  5. the true/false says if the window should close when they switch to another window):
  6. <script type="text/javascript"><!--
  7. //you can style this, but don't try to text-align it to the right, it will break the resizing effect
  8. //keep it narrow, if it is wider than the image, the window will wrap to this width
  9. //the makeright class tells the script to automatically align it to the right
  10. var extraHTML = '<br><a href="javascript:window.close()" style="text-decoration:none;color:#777;background-color:#bbb;font-weight:bold;border-left:2px solid #000;" class="makeright">Close<\/a>';
  11. //--></script>
  12. <a href="me.jpg" onclick="return popImageExtra(this.href,'Site author',true,3000,extraHTML);">link</a>
  13. */
  14.  
  15. //really not important (the first two should be small for Opera's sake)
  16. PositionX = 10;
  17. PositionY = 10;
  18. defaultWidth  = 600;
  19. defaultHeight = 400;
  20.  
  21. //don't touch (except to modify the window contents)
  22. function popImageExtra(imageURL,imageTitle,AutoClose,oTimeClose,extraHTML){
  23.     var imgWin = window.open('','_blank','scrollbars=yes,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
  24.     if( !imgWin ) { return true; } //popup blockers should not cause errors
  25.     imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+
  26.         'function getRefToDivMod( divID, oDoc ) {\n'+
  27.             'if( !oDoc ) { oDoc = document; }\n'+
  28.             'if( document.layers ) {\n'+
  29.             'if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {\n'+
  30.             'for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {\n'+
  31.             'y = getRefToDivNest(divID,oDoc.layers[x].document); }\n'+
  32.             'return y; } }\n'+
  33.             'if( document.getElementById ) { return oDoc.getElementById(divID); }\n'+
  34.             'if( document.all ) { return oDoc.all[divID]; }\n'+
  35.             'return document[divID];\n'+
  36.         '}\n'+
  37.         'function resizeWinTo() {\n'+
  38.             'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
  39.             'if( !document.images[0].height || window.doneAlready ) { return; }\n'+ //in case images are disabled
  40.             'var oH = getRefToDivMod( \'myID\' ); if( !oH ) { return false; }\n'+
  41.             'var oW = oH.clip ? oH.clip.width : oH.offsetWidth;\n'+
  42.             'var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }\n'+
  43.             'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled
  44.             'window.doneAlready = true;\n'+ //for Safari and Opera
  45.  
  46.             'var mH = screen.availHeight-200, mW = screen.availWidth-200;\n'+
  47.             'if( oH > mH || oW > mW ) {\n'+
  48.  
  49.             'document.images[0].fullH = oH;\n'+
  50.             'document.images[0].fullW = oW;\n'+
  51.  
  52.             'var hDif = oH - document.images[0].height;\n'+
  53.             'var wDif = oW - document.images[0].width;\n'+
  54.             'mH = mH - hDif; mW = mW - wDif;\n'+
  55.             'mH = mH \/ document.images[0].height;\n'+
  56.             'mW = mW \/ document.images[0].width;\n'+
  57.             'var zoomFactor = ( mH < mW ) ? mH : mW;\n'+
  58.             'oH = Math.floor( document.images[0].height * zoomFactor );\n'+
  59.             'oW = Math.floor( document.images[0].width * zoomFactor );\n'+
  60.  
  61.             'document.images[0].style.cursor = \'crosshair\';\n'+
  62.             'document.images[0].title = \'Click to resize image\';\n'+
  63.             'document.images[0].oldHeight = document.images[0].height;\n'+
  64.             'document.images[0].oldWidth = document.images[0].width;\n'+
  65.             'document.images[0].newHeight = oH;\n'+
  66.             'document.images[0].newWidth = oW;\n'+
  67.             'document.images[0].onclick = function () { '+
  68.             'if( this.oldHeight == this.height ) { '+
  69.             'this.height = this.newHeight; this.width = this.newWidth; '+
  70.             'setTimeout(\'window.resizeTo(\'+this.oW+\',\'+this.oH+\'); '+
  71.             'if( !window.opera ) { '+
  72.             'window.moveTo(\'+Math.round((this.scW-this.oW)/2)+\','+
  73.             '\'+Math.round((this.scH-this.oH)/2)+\'); }\',1);\n'+
  74.             '} else { this.height = this.oldHeight; this.width = this.oldWidth; '+
  75.             'window.moveTo(0,0); window.resizeTo(this.scW,this.scH); '+
  76.             'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
  77.             'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
  78.             'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
  79.             'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
  80.             'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
  81.             'if( this.fullH < myH ) { var rs = this.fullH - myH; window.resizeBy(0,rs); '+
  82.             'if( !window.opera ) { window.moveBy(0,Math.round(rs/-2)); } }'+
  83.             'if( this.fullW < myW ) { var rs = this.fullW - myW; window.resizeBy(rs,0); '+
  84.             'if( !window.opera ) { window.moveBy(Math.round(rs/-2),0); } }'+
  85.             '} };\n'+
  86.  
  87.             'document.images[0].height = oH;\n'+
  88.             'document.images[0].width = oW;\n'+
  89.             'oH += hDif; oW += wDif;\n'+
  90.             '}\n'+
  91.  
  92.             'if(document.getElementsByTagName) {\n'+
  93.                 'for( var l = document.getElementsByTagName(\'a\'), x = 0; l[x]; x++ ) {\n'+
  94.                     'if(l[x].className==\'makeright\'&&!l[x].style.position){\n'+
  95.                         'l[x].style.position=\'relative\';\n'+
  96.                         'l[x].style.left=(document.images[0].width-(l[x].offsetWidth+l[x].offsetLeft))+\'px\';\n'+
  97.             '}}}\n'+
  98.             'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
  99.             'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
  100.             'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
  101.             'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
  102.             'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
  103.             'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
  104.             'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
  105.             'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
  106.             'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
  107.  
  108.             'document.images[0].oH = oH;\n'+
  109.             'document.images[0].oW = oW;\n'+
  110.             'document.images[0].scH = scH;\n'+
  111.             'document.images[0].scW = scW;\n'+
  112.  
  113.             'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
  114.             (oTimeClose?('window.setTimeout(\'window.close()\','+oTimeClose+');\n'):'')+
  115.         '}\n'+
  116.         '<\/script>'+
  117.         '<\/head><body onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
  118.         (document.layers?('<layer left="0" top="0" id="myID">'):('<div style="position:absolute;left:0px;top:0px;display:table;" id="myID">'))+
  119.         '<img src="'+imageURL+'" alt="Loading image ..." title="" onload="resizeWinTo();">'+
  120.         (extraHTML?extraHTML:'')+(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
  121.     imgWin.document.close();
  122.     if( imgWin.focus ) { imgWin.focus(); }
  123.     return false;
  124. }
  125.  
But how do I get My code(below) to :

1. reduce the image dimensions
2. trigger the code above (or similar lightbox code that requires thumbs to be e.g rel='lightbox') ?

Even something like this would be good
http://www.c6software.com/Products/P...#Prerequisites

Expand|Select|Wrap|Line Numbers
  1. <script type='text/javascript'>
  2. <!--
  3. function ResizeThem(){
  4. maxheight=250;
  5. maxwidth= 250;
  6. imgs=document.getElementsByTagName("img");
  7. for (p=0; p<imgs.length; p++) {
  8. if (imgs[p].getAttribute("alt")=="user posted image") {
  9. w=parseInt(imgs[p].width);
  10. h=parseInt(imgs[p].height);
  11. if (parseInt(imgs[p].width)>maxwidth) {
  12. imgs[p].style.cursor="pointer";
  13. imgs[p].setAttribute('title','Reduced Image - Click to see full size');
  14. imgs[p].onclick=new Function("iw=window.open(this.src,'ImageViewer','resizable=1,scrollbars=1');iw.focus()");
  15. imgs[p].height=(maxwidth/imgs[p].width)*imgs[p].height;
  16. imgs[p].width=maxwidth;}
  17. if (parseInt(imgs[p].height)>maxheight) {
  18. imgs[p].style.cursor="pointer";
  19. imgs[p].onclick=new
  20. Function("iw=window.open(this.src,'ImageViewer','resizable=1,scrollbars=1');iw.focus()");
  21. imgs[p].width=(maxheight/imgs[p].height)*imgs[p].width;
  22. imgs[p].height=maxheight;}}}}
  23. ResizeThem()
  24. //-->
  25. </script>
  26.  
  27.  
Apr 26 '08 #27
acoder
16,027 Recognized Expert Moderator MVP
But how do I get My code(below) to :

1. reduce the image dimensions
2. trigger the code above (or similar lightbox code that requires thumbs to be e.g rel='lightbox') ?
1. Just set the width or height to a fixed size.

2. Change the onclick, or for lightbox, set the rel attribute. If you don't want to change the code, try using an alternative/clone that doesn't require setting attributes.
Apr 26 '08 #28

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3662
by: rnd | last post by:
Hi all! could you kindly help me to solve a compatibility problem that involves Internet Explorer and NN/Mozilla. I created a html page that contains a form (its name is "Modulo") and some text boxes. After clicking on a button, a popup appears. I tried to modify the text of "Testo" textbox from the popup windows by using the following javascript code: window.opener.Modulo.Testo.value=window.opener.Modulo.Testo.value + " This
12
3267
by: Bart | last post by:
Hallo, I'm have a problem with the following script: function wr(s) { //Just got tired of writing document.write, //so I created a shorthand version document.write(s);
6
1761
by: Gary Mayor | last post by:
Hi, I'm trying to make it so when I click a image it prints out the image again and a load of other stuff. So far i've got this far. <html> <head> <script language="JavaScript" type=""> document.onmousedown = onmousedown; function onmousedown(e) {
1
1534
by: David Smith | last post by:
I have the following snippet which will not render the control on the page: foreach(DataRow dr in ds.Tables.Rows) { System.Web.UI.HtmlControls.HtmlTableRow r = new System.Web.UI.HtmlControls.HtmlTableRow(); System.Web.UI.HtmlControls.HtmlTableCell c1 = new
3
2774
by: kev | last post by:
Hello, I posted a question a while ago on tabbed pages, how to set it to invisible when the text box is empty.It was answered by Rick and the code ran perfectly. However, i tried using the same code for another scenario and it gives me compile error:method or data member not found. My scenario is i have a nested tab page.My main tabbed page has 4 tabs, About, SafetyLevel1,SafetyLevel2,SafetyLevel3. Inside this main, i created a...
2
1208
by: saurabhpant | last post by:
Hi friends, I am working on a blog application.In this application we use an iframe for writing the text I am using the javascript for storing the value of iframe in a temporary variable.The code is given below:--- var tmpIframe=iframe.document.body.innerText; it works perfectly in IE but not working in Mozilla. help me asap. Regards Saurabh
2
2040
by: gunnuk | last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>WELCOME TO HEMA CREATIVE HOUSE</title> <style type="text/css"> <!-- @import url("css/IDESIGN 1.css"); @import url("css/IDESIGN.2.css"); body {
3
1433
by: bnashenas1984 | last post by:
Hi everyone I have a HTML page which has some dynamic parts. The problem is that this page works fine in IE but not in MOZILLA ( doesn't work att all in mozilla ) here is an example: ------------------------------------------ <table id="searchtable" > <tr> <td> Some text here... </td>
1
1840
by: tegdim | last post by:
Hello, I'm working on a machine learning project that I have lots of HTML news stories to work with. I made an online tool that lets me look at these pages via mozilla and hand label them by adding my own tags into the DOM. The problem I've found is that the pages I'm using are being tidied by Mozilla. For example, <p/> is changed into proper <p> and </p> tags. The problem is that I also want to be able to process these pages without...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.