Sure, go ahead.
Sure, go ahead.
Okay so here it goes:
PHP reference (getOffers.php):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();
Apologies for the awful formatting - it looks better in Notepad++, I swear!Code:<?php include_once("db_connect.php"); $sql = "big long sql statement"; $rsOffer = mysql_query( $sql ); $offer = mysql_fetch_assoc($rsOffer); echo $offer['offer']; ?>
Lack of JSON makes me sad. BTW, you forgot to use your specialOfferDiv variable
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.
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>
no. it's just Cloudflares tracking code.
And Google Analytics.
To me it looks like it does something with facebook AND twitter:
Although I can't find anywhere in the code where it submits data.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);
that's a cloudflare script
What is the best way of creating a logo or text out of photographed text?
This image in my case:
![]()
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.
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
Plain JS, please :)
It's so easy in plain javascript anyway:
Code:(function(document){ document.getElementById('the_div').style.height = document.body.clientHeight + 'px'; })(document);
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!
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();
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?
Are you talking about a sticky footer?
http://ryanfait.com/sticky-footer
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.
.. 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.
This sounds something like my problem too! :D
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.
The solution I posted works in all browsers actually.
You may need to set the html and body element to have height 100% though.
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!
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
learning rails without knowing ruby is a bad idea
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.
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
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
I'm learning twisted if that counts
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.
I really, really don't get what they're trying to achieve. And you're right!
My bank does the same thing, 8 characters too
If my bank did that I'd switch to a new one in an instant.