Jump to content

hellouthere

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.flybevirtual.co.uk

Profile Information

  • Gender
    Not Telling

hellouthere's Achievements

Member

Member (2/5)

0

Reputation

  1. I used <!--[if IE] --> To solve the problem!
  2. Worked a treat! Thanks very much!
  3. if this is an ie6 problem and i cant do anything could someone let me know please
  4. I'm trying to change a style using javascript, its all working ok except changing a background image in ie6... hellouthere.homelinux.com/eanda The site uses AJAX to navigate, on each page the image below the logo should be updated, this works well in FF IE7 and Safari but previous to IE7 all the AJAX works except the updating the image on each page. I'm using AJAx but I think this is a pure javascript problem as everything works fine in other browsers. I know IE6 is a pain but is there any workaround to get this to work? This is the function to change the text and image for each page... it updates the background image of the pic1 div and adds the correct text to the required div (objID). function navto(serverPage, objID) { document.getElementById("pic1").style.backgroundImage = "url(images/" + serverPage + ".png)"; var obj = document.getElementById(objID); xmlhttp.open("GET", serverPage + ".inc"); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } When the homepage opens it uses this function to load the image and text and that works fine, its when it comes to changing to other pages that it fails... Thanks in advance
  5. yup, its working at the moment for me in both, ill stick with it as it is at the moment and look into jQuery soon
  6. I'm working on a site. I'm going for tableless, vertically and horizontally centred and compatible with IE and FF... Ive got FF working fine, IE has a few problems... possibly something to do with the mixture of float attributes... Could someone have a look for me? http://hellouthere.homelinux.com/eanda on IE the contact us page is disturbed... the copyright notice is low and on all of the pages except the home page an image should appear below the e&a logo. Not sure what to do about this, any help is welcome.
  7. this is my ajax.js file //variable for IE instance check var xmlhttp = false; //Check for IE try { //If javascript version > 5 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { //Older ActiveX try { //For IE xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //Non-IE browser xmlhttp = false; } } //Create javascipt instance for Non-IE browser if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); }
  8. Im trying to use a basic ajax navigation but cant get my function to work atall! this is the function pulled from the file function makerequest(serverPage, objID) { var obj = document.getElementByID(objID); xmlhttp.open("GET", serverPage, true); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } Is there anything obviously wrong with this... I call the function on body load aswell as with hyperlinks, neither work.
  9. ~Thankyou so much! worked perfectly! thankyou again!
  10. 5 files are attached, thanks [attachment deleted by admin]
  11. Thankyou for replying, i will zip up asap and attach to another post
  12. Im trying to implement AJAX into a php/mysql application ive written, at the moment im just trying to get a form to appear when a link is clicked (the link is from a polygon map on an image). I have several ajax books and have pulled most of the code from one of them... This is what i have so far... index.php <?php include("./style.css"); ?> <script src="./ajax.js"></script> <script src="./function.js"></script> <div id="main"><img src="./frontpage.jpg" border="0" usemap="#Map"/> <map name="Map" id="Map"> <area shape="poly" coords="362,96,495,95,490,191,362,178" href="#" /> <area shape="poly" coords="31,38,49,214,298,182,298,60" href="#" /> <area shape="poly" coords="338,217,375,206,469,223,467,314,428,334,336,305" href="#" /> <area shape="poly" coords="8,387,50,433" href="#" /> <area shape="poly" coords="4,386,52,431,133,433,380,329,258,287,258,266,249,266,234,278,216,272,143,293,189,310,195,319,181,331" href="#" /> <area shape="poly" coords="53,365,141,337,122,332,94,338,91,328,107,318,112,309,114,291,105,265,91,248,74,245,53,252,42,274,42,295,40,322,58,331,73,329,75,344,63,347,64,340,48,332,42,334,47,342,52,346,52,355" href="javascript:createlogin()"/> </map> </div> <div id="login" class="login"></div> style.css <style> body { text-align: center; } #main { padding:50px; } .login { position:absolute; left:0px; top:0px; text-align:left; visibility:hidden; height:0px; width:0px; background:#FAF8C5; border-style:solid; border-width:2px; border-color:#EAEE4F; } </style> ajax.js //variable for IE instance check var xmlhttp = false; //Check for IE try { //If javascript version > 5 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { //Older ActiveX try { //For IE xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //Non-IE browser xmlhttp = false; } } //Create javascipt instance for Non-IE browser if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } function.js function createlogin (e) { theObject = document.getElementById("login"); theObject.style.visibility = "visible"; theObject.style.height = "150px"; theObject.style.width = "250px"; var posx = 0; var posy = 0; posx = e.clientX + document.body.scrollLeft; posy = e.clientY + document.body.scrollTop; theObject.style.left = posx + "px"; theObject.style.top = posy + "px"; //location var objID = "login"; var serverPage = "login.php"; var obj = document.getElementById(objID); xmlhttp.open("GET", serverPage); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { obj.innerHTML = xmlhttp.responseText; } } xmlhttp.send(null); } function closelogin() { theObject = document.getElementById("login"); theObject.style.visibility = "hidden"; theObject.style.height = "0px"; theObject.style.width = "0px"; } login.php <form action='#' method='post'> <div align="center" style="padding-top:5px"> Username: <input type="text" name="user"> <br> Password: <input type="password" name="pass"> <br> <input class="button" type="Submit" value="Login"> </div> </form> <div align="right"><a href="javascript:closelogin()">close</a></div> The result at the moment is that when the link is clicked the layer appears at the very top left (0, 0). It has the correct dimensions (250,150) but is empty. So its not getting the location and its not putting in the login.php file... no idea what could be the problem here. Im new to ajax and not amazing with javascript... Thanks in advance to anyone who can shed some light on my situation.
  13. $word = "cabbages_green"; $newword = explode("_", $word); $newword[0] = cabbages $newword[1] = green
  14. I am pulling numbers from a database which have large amounts of decimal places by default (need to be left this way) Therefore some numbers come out as 50.00000 or 0.34000 I would like to be able to remove the trailing zeros and decimal point if appropriate to tidy up the variables for display... Thanks, In advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.