1. Post #1641
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Sure, go ahead.
    Reply With Quote Edit / Delete United Kingdom Show Events

  2. Post #1642
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Okay so here it goes:

    Code:
    // Browser determination section up here (Is it firefox, safari, IE?...)
    
    httpRequest.onreadystatechange = function() 
    {
         var specialOfferDiv = document.getElementById('special_offer');
         document.getElementById("special_offer").innerHTML = httpRequest.responseText;
    };
    
        httpRequest.open("GET", "getOffers.php", true);
        httpRequest.send();
    PHP reference (getOffers.php):
    Code:
    <?php
        include_once("db_connect.php");
        $sql = "big long sql statement";
        $rsOffer = mysql_query( $sql );
        $offer = mysql_fetch_assoc($rsOffer);
        echo $offer['offer'];
    
    ?>
    Apologies for the awful formatting - it looks better in Notepad++, I swear!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 1 (list)

  3. Post #1643
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Lack of JSON makes me sad. BTW, you forgot to use your specialOfferDiv variable
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  4. Post #1644
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Good point, I just re-did it haha. I'll look into JSON for the next time, it was more of a personal goal to do it without anything else : )

    I'm now figuring out the setInterval command - and so far all I've managed to do is destroy my browser after 9 iterations haha.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Useful Useful x 1 (list)

  5. Post #1645
    Richy19's Avatar
    May 2010
    5,412 Posts
    This is the only place I could think of to ask but, does this page's javascript do anything weird with facebook and twitter?

    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!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" xml:lang="en" lang="en">
    <head> <script type="text/javascript">
    //<![CDATA[
    try{if (!window.CloudFlare) { var CloudFlare=[{verbose:0,p:0,byc:0,owlid:0,mirage:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/v=1443929931/"},atok:"0c11c11e8ed5801994f5be9edb6004f0",zone:"boxulo.us",rocket:"a",apps:{"ga_key":{"ua":"UA-27478034-1","ga_bs":"2"}}}];document.write('<script type="text/javascript" src="//ajax.cloudflare.com/cdn-cgi/nexp/v=3368044129/cloudflare.min.js"><'+'\/script>')}}catch(a){};
    //]]>
    </script>
    <script type="text/javascript">
    //<![CDATA[
    window.__CF=window.__CF||{};window.__CF.AJS={"ga_key":{"ua":"UA-27478034-1","ga_bs":"2"}};
    //]]>
    </script>
    <title>404 - Not Found</title>
    <script type="text/javascript">
    /* <![CDATA[ */
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-27478034-1']);
    _gaq.push(['_trackPageview']);
    
    (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
    
    (function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
    /* ]]> */
    </script>
    </head>
    <body>
    <h1>404 - Not Found</h1>
    </body>
    </html>
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  6. Post #1646
    RusselG's Avatar
    February 2011
    608 Posts
    This is the only place I could think of to ask but, does this page's javascript do anything weird with facebook and twitter?
    no. it's just Cloudflares tracking code.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Informative Informative x 2 (list)

  7. Post #1647
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    no. it's just Cloudflares tracking code.
    And Google Analytics.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  8. Post #1648
    rookwood101's Avatar
    September 2011
    256 Posts
    And Google Analytics.
    To me it looks like it does something with facebook AND twitter:

    Code:
    (function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
    Although I can't find anywhere in the code where it submits data.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  9. Post #1649
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    To me it looks like it does something with facebook AND twitter:

    Code:
    (function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
    Although I can't find anywhere in the code where it submits data.
    that's a cloudflare script
    Reply With Quote Edit / Delete Mac Australia Show Events Useful Useful x 1 (list)

  10. Post #1650
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    What is the best way of creating a logo or text out of photographed text?

    This image in my case:

    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  11. Post #1651
    rookwood101's Avatar
    September 2011
    256 Posts
    Well I made a crop of the image to the most clear character (the centre 'R'):


    Uploaded it to this site: http://www.myfonts.com/WhatTheFont/

    and it seemed to think that the font was either Bookman Old Style Bold or URW Bookman Bold both of those fonts look similar enough to what you put in the picture for you to be able to get away with using them.

    Edited:

    In fact, Bookman Old Style Bold looks like it's exactly the right font.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Winner Winner x 2 (list)

  12. Post #1652
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    Well I made a crop of the image to the most clear character (the centre 'R'):


    Uploaded it to this site: http://www.myfonts.com/WhatTheFont/

    and it seemed to think that the font was either Bookman Old Style Bold or URW Bookman Bold both of those fonts look similar enough to what you put in the picture for you to be able to get away with using them.

    Edited:

    In fact, Bookman Old Style Bold looks like it's exactly the right font.
    Thanks. That was extremely useful.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Friendly Friendly x 1 (list)

  13. Post #1653
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    How would I make an element (DIV) have the height of the html document - somepx in JS?
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  14. Post #1654
    jung3o's Avatar
    October 2011
    2,165 Posts
    How would I make an element (DIV) have the height of the html document - somepx in JS?
    do you want plain JS or can it be with jquery
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #1655
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    do you want plain JS or can it be with jquery
    Plain JS, please :)
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  16. Post #1656
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    It's so easy in plain javascript anyway:

    Code:
    (function(document){
        document.getElementById('the_div').style.height = document.body.clientHeight + 'px';
    })(document);
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  17. Post #1657
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    mind explaining the script too? Don't want too use something I don't know how works! Doesn't know very much about javascript. Understand the "document.getElementByID('ID').style.height = + 'px' " part and i guess clientHeight just returns the size of the body?

    what is the last (document) for? and why have you () around function?

    -Thanks anyways!
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  18. Post #1658
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    I wrapped it in a self executing anonymous function with the document object passed in as an argument. The benefit of that is to keep any variables you create from leaking into the DOM, the DOM is like a dictionary for all browser specific objects/variables etc. The other benefit of it is that it saves the document object so it doesn't have to look it up every time you use it and if you ran the code through a JavaScript minifier it would rename document to a single letter saving a quite few bytes.

    Edited:

    A function wrapped in parathesis like this: (function_geos_here)(); means it will be executed when the javascript engine interrupts it instead of having to be run manually like this:

    Code:
    function blah(){
       alert('blah');
    }
    
    blah();
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  19. Post #1659
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    Code:
    <div height 100px>
    </div>
    
    <div height x>
     
     <div height y>
     </div>
    
    </div>

    div x needs to touch the bottom of the screen if div y is smal.
    div y is sometimes larger then the screen and sometimes smaller.

    Basically need an min-height for div X that is 100%-100px. I'm pretty sure I asked this before but I can't find it anywhere. How do I do it?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  20. Post #1660
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Are you talking about a sticky footer?

    http://ryanfait.com/sticky-footer
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  21. Post #1661
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    Not sure.

    I have a div at the top of my page with a fixed height (150px).
    Below that I have a container div.

    Together those two divs need to have a minimum height of 100% with the container div stretching all the way to the bottom.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  22. Post #1662
    zhed+redball.jpg
    xmariusx's Avatar
    May 2010
    1,447 Posts
    It's so easy in plain javascript anyway:

    Code:
    (function(document){
        document.getElementById('the_div').style.height = document.body.clientHeight + 'px';
    })(document);
    .. makes the div client height * px or something? I got an insane long page! :D
    It was meant for making the middle div fill up the rest of the page.


    Not sure.

    I have a div at the top of my page with a fixed height (150px).
    Below that I have a container div.

    Together those two divs need to have a minimum height of 100% with the container div stretching all the way to the bottom.
    This sounds something like my problem too! :D
    Reply With Quote Edit / Delete Windows 7 Norway Show Events

  23. Post #1663
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    Use position absolute on the container and set the top to the height of the header and bottom to 0.

    Edited:

    If you want it to be centered add left: 50% and margin: 0 0 0 -{half the width of the container}px;
    Reply With Quote Edit / Delete Mac United Kingdom Show Events

  24. Post #1664
    I paid $2 for this
    Miljaker's Avatar
    October 2010
    791 Posts
    Use position absolute on the container and set the top to the height of the header and bottom to 0.

    Edited:

    If you want it to be centered add left: 50% and margin: 0 0 0 -{half the width of the container}px;
    Doesn't work in IE7, and it needs to work in IE7.

    Anyway, I just haxed and used an image instead of css so now I just put the top div in the container as wel. Nothing important and don't feel like wasting time on it.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  25. Post #1665
    Gold Member
    jaybuz's Avatar
    May 2006
    5,516 Posts
    The solution I posted works in all browsers actually.

    You may need to set the html and body element to have height 100% though.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  26. Post #1666
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Just posted to say thanks to everyone who helped me the other day. You were useful, and I appreciate it.

    Since then I've been able to expand and do nicer things with my code. Every day is a learning day!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 2Informative Informative x 1 (list)

  27. Post #1667
    Do not (c)lick
    Dennab
    March 2012
    1,461 Posts
    Just a quick question:

    Should I start learning PHP or Rails? I've heard brilliant things about both but I can't get my head around which one to devote myself to.
    Reply With Quote Edit / Delete Windows XP United Kingdom Show Events Funny Funny x 1 (list)

  28. Post #1668
    jung3o's Avatar
    October 2011
    2,165 Posts
    Just a quick question:

    Should I start learning PHP or Rails? I've heard brilliant things about both but I can't get my head around which one to devote myself to.
    learn python
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2Disagree Disagree x 1 (list)

  29. Post #1669
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Just a quick question:

    Should I start learning PHP or Rails? I've heard brilliant things about both but I can't get my head around which one to devote myself to.
    learning rails without knowing ruby is a bad idea
    Reply With Quote Edit / Delete Australia Show Events Agree Agree x 3 (list)

  30. Post #1670
    Richy19's Avatar
    May 2010
    5,412 Posts
    A while back I made a website for someone but long story short they never actually used it.
    Now they loved it and wrote me a recomendation letter which I hope to use at some point but I assume if I show someone the letter they will want to see the site, I dont really want to host a copy of it so I was wondering if there is any tool that could scan through a website (if I have it on wamp or something) and create some sort of pdf or document to just be able to showcase what the website looked like.
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  31. Post #1671
    Gold Member
    Catdaemon's Avatar
    February 2005
    2,821 Posts
    A while back I made a website for someone but long story short they never actually used it.
    Now they loved it and wrote me a recomendation letter which I hope to use at some point but I assume if I show someone the letter they will want to see the site, I dont really want to host a copy of it so I was wondering if there is any tool that could scan through a website (if I have it on wamp or something) and create some sort of pdf or document to just be able to showcase what the website looked like.
    Reply With Quote Edit / Delete Windows 7 Show Events Programming King Programming King x 1 (list)

  32. Post #1672
    Richy19's Avatar
    May 2010
    5,412 Posts
    multiple pages...
    but yes im just doing that, and then il just edit all the pages in gimp together to make a poster kind of thing
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  33. Post #1673
    RAPISTS ARE OPPRESSED
    mobrockers2's Avatar
    April 2011
    12,403 Posts
    A while back I made a website for someone but long story short they never actually used it.
    Now they loved it and wrote me a recomendation letter which I hope to use at some point but I assume if I show someone the letter they will want to see the site, I dont really want to host a copy of it so I was wondering if there is any tool that could scan through a website (if I have it on wamp or something) and create some sort of pdf or document to just be able to showcase what the website looked like.
    Is it html only? If so host on dropbox.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  34. Post #1674
    Richy19's Avatar
    May 2010
    5,412 Posts
    Is it html only? If so host on dropbox.
    Noo threres php as well, Im ok just making a montage of how it looks.
    I mean the only purpose is to show i actually did the website and didn just get some randomer to make me the letter
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  35. Post #1675
    Do not (c)lick
    Dennab
    March 2012
    1,461 Posts
    learn python
    I'm learning twisted if that counts
    Reply With Quote Edit / Delete Windows 8 United Kingdom Show Events Winner Winner x 1 (list)

  36. Post #1676
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    Here's a funny one for you. I rent my domain name from 123-reg.co.uk, and they've recently adopted a new password validation system.

    ALL passwords now HAVE to be EXACTLY 8 characters long. Why? At first thought I'd have thought it was to save on database size, but surely that'd be 8 or less characters.

    Thoughts?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 3 (list)

  37. Post #1677
    Gold Member
    AndrewPH's Avatar
    July 2010
    704 Posts
    Here's a funny one for you. I rent my domain name from 123-reg.co.uk, and they've recently adopted a new password validation system.

    ALL passwords now HAVE to be EXACTLY 8 characters long. Why? At first thought I'd have thought it was to save on database size, but surely that'd be 8 or less characters.

    Thoughts?
    There's no possible way that's safe.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  38. Post #1678
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    There's no possible way that's safe.
    I really, really don't get what they're trying to achieve. And you're right!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  39. Post #1679
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    Here's a funny one for you. I rent my domain name from 123-reg.co.uk, and they've recently adopted a new password validation system.

    ALL passwords now HAVE to be EXACTLY 8 characters long. Why? At first thought I'd have thought it was to save on database size, but surely that'd be 8 or less characters.

    Thoughts?
    My bank does the same thing, 8 characters too
    Reply With Quote Edit / Delete Windows 7 France Show Events

  40. Post #1680
    Airport Dweller
    Slater's Avatar
    October 2005
    1,201 Posts
    If my bank did that I'd switch to a new one in an instant.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 3 (list)