CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    Resolved not displaying IE[fixed]

    in ie it doesnt display anything(completly blank)
    and in firefox it works perfect..

    here are my files (u dont need the images to test it .. do u ..?)

    index.js
    Code:
    function newXMLHTTP()
    {
    	var ret = null;
    	try
    	{
    		ret = new XMLHttpRequest();
    	}
    	catch(e)
    	{
    		try
    		{
    			ret= new ActiveXObject("Msxml2.XMLHTTP");
    		}
    		catch(e)
    		{
    			ret = new ActiveXObject("Microsoft.XMLHTTP")
    		}
    	}
    	return ret
    }
    
    function navigate(page)
    {
    	if(!document.navigate_content)
    	{
    		document.navigate_content = document.getElementById('content');
    		if(!document.navigate_content)
    			return;
    	}
    	if(!document.navigate_http)
    	{
    		document.navigate_http = newXMLHTTP();
    		if(!document.navigate_http)
    		{
    			document.navigate_content.innerHTML = 'Deze browser ondersteunt geen XMLHttpRequest.';
    			return;
    		}
    	}
    	if(!document.navigate_load)
    	{
    		document.navigate_load = document.getElementById('load');
    		if(document.navigate_load)
    			document.navigate_load.style.visibility = 'visible';
    	}
    	else
    		document.body.appendChild(document.navigate_load);
    	try
    	{
    		document.navigate_http.open("GET", page, false);
    		document.navigate_http.send(null);
    	}
    	catch(e)
    	{
    		document.navigate_content.innerHTML = 'Pagina \'' + page + '\' kon niet worden opgehaald (' + String(e).split('(')[1].split(')')[0] + ').';
    	}
    	if(document.navigate_http.readyState == 4)
    		document.navigate_content.innerHTML = document.navigate_http.responseText ?
    							document.navigate_http.responseText :
    							'Deze pagina heeft geen text.';
    	document.navigate_load = document.navigate_load.parentNode.removeChild(document.navigate_load);
    	delete document.navigate_http;
    	document.navigate_http = null;
    }
    index.css
    Code:
    BODY, A, TABLE, TR, TD, IMG, DIV, SPAN, IFRAME
    {
    	background: transparent;
    	border: 0;
    	border-collapse: collapse;
    	border-spacing: 0;
    	color: black;
    	cursor: default;
    	empty-cells: show;
    	font-weight: bold;
    	margin: 0;
    	overflow: hidden;
    	padding: 0;
    	vertical-align: top;
    	table-layout: fixed;
    	text-align: left;
    }
    
    BODY
    {
    	margin: 1%;
    	margin-bottom: 0;
    	overflow: auto;
    }
    
    DIV.lnk, A, A:link, A:visited, A:focus, A:active
    {
    	border: 1px solid transparentk;
    	color: white;
    	text-decoration: none;
    }
    
    DIV.lnk
    {
    	width: 96%;
    }
    
    DIV.lnk:hover, a:hover
    {
    	-moz-opacity: 0.85;
    	background: white;
    	border: 1px solid black;
    	color: #3399cc;
    	filter: alpha(opacity = 85);
    	opacity: 0.85;
    }
    
    IFRAME#noscript_fix
    {
    	height: 0;
    	position: fixed;
    	visibility: hidden;
    	width: 0;
    }
    
    IMG#bg
    {
    	-moz-user-select: none;
    	height: 100%;
    	position: fixed;
    	margin: -1%;
    	width: 100%;
    	z-index: 0;
    }
    
    IMG#load
    {
    	-moz-user-select: none;
    	border: 1px solid black;
    	left: 45%;
    	position: fixed;
    	top: 45%;
    	visibility: hidden;
    	z-index: 255;
    }
    
    DIV.block
    {
    	background: #3399cc;
    	border: 1px solid black;
    }
    
    DIV.block DIV.title
    {
    	-moz-user-select: none;
    	background: url(img/title_bg.jpg) repeat-x;
    	border-bottom: 1px solid black;
    	text-align: center;
    }
    
    DIV.block DIV.content
    {
    	padding: 3%;
    }
    
    DIV.border
    {
    	-moz-opacity: 0.85;
    	background: darkgrey;
    	border: 1px solid black;
    	filter: alpha(opacity = 85);
    	opacity: 0.85;
    	padding: 2%;
    	position: relative;
    	width: 96%;
    }
    
    DIV.border DIV.banner
    {
    	-moz-user-select: none;
    	background: url(img/banner_bg.jpg) repeat-x;
    	border: 1px solid black;
    	height: 150px;
    	width: 100%;
    }
    
    DIV.border TABLE.interface
    {
    	width: 100%;
    }
    
    DIV.border TABLE.interface TD.space
    {
    	height: 3%;
    	width: 3%;
    }
    
    DIV.border TABLE.interface TD.menu
    {
    	-moz-user-select: none;
    	width: 15%;
    }
    
    DIV.border TABLE.interface TD.content
    {
    	width: 82%;
    }
    
    
    DIV.border DIV.block DIV#footer
    {
    	-moz-user-select: none;
    	font-size: x-small;
    	padding: 0.5%;
    	text-align: center;
    }
    index.html
    Code:
    <HEAD>
    	<TITLE>CJ's Portofolio</TITLE>
    	<LINK rel="stylesheet" type="text/css" href="index.css"/>
    	<SCRIPT type="text/javascript" src="index.js"/>
    
    <BODY onload="navigate('pages/home.html')">
    	<IFRAME name="noscript_fix" id="noscript_fix"></IFRAME>
    	<IMG id="bg" src="img/bg.jpg"/>
    	<IMG id="load" src="img/load.gif"/>
    	<DIV class="border">
    		<DIV class="banner">
    			<IMG src="img/banner.jpg">
    		</DIV>
    		<BR/>
    		<TABLE class="interface">
    			<TD class="menu">
    				<DIV class="block">
    					<DIV class="title">
    						<IMG src="img/menu.jpg">
    					</DIV>
    					<DIV class="content">
    						<DIV class="lnk" onclick="navigate('pages/home.html')">Home</DIV>
    						<DIV class="lnk" onclick="navigate('pages/gegevens.html')">Gegevens</DIV>
    						<DIV class="lnk" onclick="navigate('pages/hobbies.html')">Hobbies</DIV>
    						<DIV class="lnk" onclick="navigate('pages/werk_ervaring.html')">Werkervaring</DIV>
    						<DIV class="lnk" onclick="navigate('pages/competenties.html')">Competenties</DIV>
    						<DIV class="lnk" onclick="navigate('pages/school_ervaring.html')">School ervaring</DIV>
    			<TD class="space">
    			<TD class="content">
    				<DIV class="block">
    					<DIV class="title">
    						<IMG src="img/content.jpg">
    					</DIV>
    					<DIV class="content">
    						<DIV id="content">
    							<NOSCRIPT>
    								Om deze website te kunnen browsen heeft u javascript nodig, zet deze aan aub.
    							</NOSCRIPT>
    		</TABLE>
    		<BR/>
    		<DIV class="block">
    			<DIV class="content" id="footer">
    				© <A href="http://shinyu.m-ka.net" target="_blank">Shinyu Studios</A> - 2007
    Last edited by Mitsukai; October 7th, 2007 at 08:16 AM.

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: not displaying IE

    IE gets picky with synchronous AJAX. Try...

    Code:
    document.navigate_http.open("GET", page, true);
    Instead of...

    Code:
    document.navigate_http.open("GET", page, false);
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    Re: not displaying IE

    fixed most of my code...
    but AJAX is still not working...


    nvm it works when i upload it @_@
    Last edited by Mitsukai; October 7th, 2007 at 08:16 AM.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: not displaying IE

    Put some alerts at various point in your code to see exactly where IE fails to work. Then post back.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    Re: not displaying IE

    i did and i came to conclusion XMLHTTP :: open, only works when your page is uploaded...(must be a bug in IE)

  6. #6
    Join Date
    May 2002
    Posts
    10,943

    Re: not displaying IE

    Are you not even using onreadystatechange?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  7. #7
    Join Date
    Aug 2005
    Location
    Netherlands, The
    Posts
    2,184

    Re: not displaying IE

    i tried both and it doesnt matter.
    its just the problem if it is uploaded or not.

  8. #8
    Join Date
    May 2002
    Posts
    10,943

    Re: not displaying IE

    Quote Originally Posted by Mitsukai
    i did and i came to conclusion XMLHTTP :: open, only works when your page is uploaded...(must be a bug in IE)
    I have never had problems with AJAX in any browser. I don't believe it is an IE bug. Also, what you do you mean by "only works when your page is uploaded?" What page? What upload?

    I suggest checking out my AJAX object. Create a new file and use my implementation with your code. See if that gives you problems.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured