Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
Nope, Javascript lets you overwrite those:
[url]http://jsfiddle.net/t2vHX/[/url]
[QUOTE=CoolCorky;32462909]How would I go about aligning these images and removing the little gap between them:
[img]http://dl.dropbox.com/u/28898399/site.PNG[/img]
The top and bottom images are in separate div tags, and the bottom image is in a table with the text to its right[/QUOTE]
Don't use tables for purposes tables are not meant for. AKA if you can't tell exactly what a table row is used for (that doesn't have anything to do with layout), then you're not supposed to use a table.
[QUOTE=deadeye536;32467897]Try:
[code]data = {address:addressName, distance:distance, price:price, company:company};[/code]
[editline]25th September 2011[/editline]
Just to see if it'll do anything. Going from False to Undefined seems like an error.
[editline]25th September 2011[/editline]
Ohhhhhhh, I think I see now. I don't think it likes you using location as a variable name. Location is like window, it's reserved. Try using a different variable name.[/QUOTE]
I changed location but it still wasn't working correctly. Now I've changed the way it works and I think it works better. What do you think? Am I doing all correctly?
[php]
function deliveryPage()
{
// reset our global value
sm.lastLocation = '';
var form = $('#delivery-form'),
input = $(form.data('input')),
spinner = $(form.data('spinner'));
if (navigator.geolocation)
{
$('#get-location').click(function(e)
{
e.preventDefault();
navigator.geolocation.getCurrentPosition(function(p)
{
// Firefox supports reverse look up (address)
var geoLocation = (p.address)
? (p.address.street + ', ' + p.address.city + ', ' + p.address.postalCode)
: (p.coords.latitude + ', ' + p.coords.longitude);
getDeliveryInfo(geoLocation, function(result)
{
spinner.fadeIn(200);
if (result)
{
input.removeClass('error').val(result.address);
$('#delivery-distance .num').html(result.distance);
$('#delivery-price .num').html('£' + result.price);
$('#delivery-company #' + result.company).show().siblings().hide();
}
else
{
input.addClass('error');
}
spinner.fadeOut();
});
});
});
}
else
{
$('#get-location').hide();
}
form.submit(function(e)
{
e.preventDefault();
getDeliveryInfo(input.val(), function(result)
{
spinner.fadeIn(200);
if (result)
{
input.removeClass('error').val(result.address);
$('#delivery-distance .num').html(result.distance);
$('#delivery-price .num').html('£' + result.price);
$('#delivery-company #' + result.company).show().siblings().hide();
}
else
{
input.addClass('error');
}
spinner.fadeOut();
});
});
}
function getDeliveryInfo(address, callback)
{
var g = google.maps,
directions = new g.DirectionsService(),
address = (address.search(', UK')) ? address : address + ', UK';
var request = {
origin: address,
destination: '52.697605, -2.021616',
travelMode: g.DirectionsTravelMode.DRIVING
};
sm.locationChanged = (sm.lastLocation != address) ? true : false;
if (sm.locationChanged && address.length > 4)
{
directions.route(request, function(response, status)
{
if (status == 'OK')
{
var route = response.routes[0],
addressName = route.legs[0].start_address,
maxTravelTime = 40,
data = false;
sm.lastLocation = (address) ? address : addressName;
sm.locationChanged = false;
var distance = (route.legs[0].distance.value / 1609.344).toFixed(1),
time = (route.legs[0].duration.value / 60),
price = Math.round(((distance * 1.8) + 10)),
company;
if (price > 135)
{
price = 156;
company = 'ml';
}
else
{
price = (price < 20) ? 19.99 : ((time < maxTravelTime) ? price : price + 15);
company = 'sm';
}
data = {
address: addressName,
distance: distance,
price: price,
company: company
};
}
else if (status == 'OVER_QUERY_LIMIT')
{
alert('We are currently expirencing technical difficulties with Google, please try again some other time.');
}
if (typeof callback == 'function') callback(data);
return true;
});
}
else
{
if (typeof callback == 'function') callback(false);
return false;
}
}
[/php]
It's pretty nice. :D
[editline]25th September 2011[/editline]
[QUOTE=CoolCorky;32462909]How would I go about aligning these images and removing the little gap between them:
[img]http://dl.dropbox.com/u/28898399/site.PNG[/img]
The top and bottom images are in separate div tags, and the bottom image is in a table with the text to its right[/QUOTE]
Don't use tables for layout.
Do any of you guys know how to go about selling a domain name? Are their sites for that kind of stuff?
The first question would be is it worth anything?
[QUOTE=TehWhale;32477163]The first question would be is it worth anything?[/QUOTE]
It's [url]http://open.gl[/url].
I heard it was illegal, although I think I remember you actually using and not acquiring it for selling only. So maybe not.
Contact the open gl people.
Anyone know any good Web Design/Development and/or startup podcasts?
How do I change the page when I click a button? I know it's used with the onClick function, i'm using this atm:
[html]onclick="parent.location='fotos.html'"[/html]
But it doesn't work.
It's [i]document.location[/i].
Do you think I could get away with using Adsense even though I'm not 18?
[QUOTE=toaster468;32497190]Do you think I could get away with using Adsense even though I'm not 18?[/QUOTE]
Probably not (but then again I've never tried), ask your parents/guardian for permission to register in his/her name.
What I'm trying to do is have a div(logoBox) with red background, then have three images in that div.
One would be centered in the div, and then one on both of the sides.
The images are all 100 px tall. The middle one is 400px wide, and both of the side ones are 253 px wide.
I want the (logoBox)'s inside height to 100 px for the images to fit exactly.
[IMAGE---------IMAGE---------IMAGE]
All of this is in a big div with a border around it.(box)
This is what I have:
[code]
#box
{
border-width: 4px;
border-style: solid;
border-color: black;
margin-left: auto;
margin-right: auto;
width: 85%;
background-color: white;
}
#logoBox
{
margin-bottom: 0px;
background-color: red;
}
#why
{
float:left;
width:30%;
}
#logo
{
margin-left: auto;
margin-right: auto;
width:30%;
}
#address
{
float:left;
width:30%;
}
[/code]
[code]
<div id="box">
<div id="logoBox">
<div id="why"><img src="img/titleWhy.png" alt="Why EHS" border="0"/></div>
<div id="logo"><img src="img/titleCenter.png" alt="cardnial logo" height="100" border="0" /></div>
<div id="address"><img src="img/titleEHS.png" alt="EHSinfo" height="100" border="0" /></div>
</div>
[other stuff would go here]
</div>
[/code]
I want the layout to look like this:
[img]http://img268.imageshack.us/img268/1796/explination.png[/img]
How it currently looks:
[img]http://img534.imageshack.us/img534/5895/currenthd.png[/img]
The first two are correct, but the third one goes off on a new line and doesn't align correctly.
(if you look at the bottom, that's a stretched 1px image, not the end of the first div)
In IE it even makes the third one go underneath anything put in the <other stuff here> spot.
This should be simple enough, but I'm a noob, so I have noob questions.
Help?
Edit:
Nevermind
What's the best way to make a website look 'fucked up' using javascript/css
There is a fiile that I want to be accessible from anywhere I go as long as I have internet.
I don't want others to be able to get to it though.
Only those wwho have the password should be able to get to the file.
I want to use PHP for this.
I was thinking about using .htaccess to secure a folder and then have php's header function go and retrieve the file. But will that work?
[CODE]<?php
if ($_COOKIE['thuperThrecret'] == "thuperThecretPassisword")
header(/*pointing to the desired private shared file*/);
?>[/CODE]
Something like that, will that work?
Or you could just eliminate PHP completely.
[url]http://tools.dynamicdrive.com/password/[/url]
[QUOTE=Jelly;32500445]Or you could just eliminate PHP completely.
[url]http://tools.dynamicdrive.com/password/[/url][/QUOTE]
You must be jelly
sorry, had to... you probably get that a lot..
thanks. I don't know why this passed my sight
[QUOTE=MXbd6tWTxB;32500475]You must be jelly
sorry, had to... you probably get that a lot..
thanks. I don't know why this passed my sight[/QUOTE]
In fact it helps me tell someones maturity.
I have someone who wants to ask a question but doesn't want to post here:
[url]http://pastebin.com/hw4NV3BX[/url]
I am just wondering if any one can answer me, In college we have a module which we are set to use .net active server page, just wondering which would be better PHP or ASP?
[QUOTE=koekje4life V2;32509520]I have someone who wants to ask a question but doesn't want to post here:
[url]http://pastebin.com/hw4NV3BX[/url][/QUOTE]
If he doesn't want to post here he can just fuck off.
I forget, do the onMouseOver, etc attributes in tags allow having newlines in them? I understand that if I'm putting enough code in to warrant newlines it'd probably be better in the main <script> section and blah blah but I just want to know.
[QUOTE=Known Havok;32514067]If he doesn't want to post here he can just fuck off.[/QUOTE]
He's perma banned :v:
[QUOTE=mobrockers2;32515140]He's perma banned :v:[/QUOTE]
I read that "he didn't want to".
I don't see why you don't simply use a .htaccess file to restrict access. Since anyone can directly access the file if it's in the public web directory, by simply visiting the file directly if they can guess the filename. Also, if it's a binary file (like a program) you won't be able to access it using this and will have to download it, then view it. If it's say, a text file, or graphic though.. this should work.
You could use $_GET to achieve this.
Filename: myfile.php ++
[code]
<?php
if($_GET['password'] == 'thisismypassword123') {
include_once('myfile.jpg');
}
else {
echo 'Invalid password';
}
[/code]
Then visit [code]http://www.yourwebsite.com/myfile.php?password=thisismypassword123[/code]
[QUOTE=MXbd6tWTxB;32500417]There is a fiile that I want to be accessible from anywhere I go as long as I have internet.
I don't want others to be able to get to it though.
Only those wwho have the password should be able to get to the file.
I want to use PHP for this.
I was thinking about using .htaccess to secure a folder and then have php's header function go and retrieve the file. But will that work?
[CODE]<?php
if ($_COOKIE['thuperThrecret'] == "thuperThecretPassisword")
header(/*pointing to the desired private shared file*/);
?>[/CODE]
Something like that, will that work?[/QUOTE]
[QUOTE=Benlecyborg;32527539]So, I'm creating this basic website for ICT. I'm using jQuery to load content from different pages (page1.html, page2.html, etc) and replace already existing content on the page. I originally made it so that it was just click on the span change1 class and it changed to page1.html, span change2 class and it changed to page2.html, eventually this would get a mess since I was adding a new function for each page. So I decided to try and set up a loop, it all seems to work apart from it's not display Page 1 ~ 5, rather Page 6, and only Page 6. I was wondering if someone could take a look at it and tell me any errors they spot :v:
[url]http://pastebin.com/EA8fHG4F[/url]
I know it's going to be something very obvious and simple I've missed and I'll feel like a dumbass afterwards.[/QUOTE]
move the for loop inside of the $(document).ready function. By the time the function executes, the for loop will already be completed and i will equal 6.
anyone understand a callback?
Anyone noticed horrible background clipping in webkit?
[img]http://dl.dropbox.com/u/386727/ScrnCap/webkit-bg-clipping.png[/img]
This is using:
[code]
background-clip: content-box
[/code]
[QUOTE=Benlecyborg;32527539]So, I'm creating this basic website for ICT. I'm using jQuery to load content from different pages (page1.html, page2.html, etc) and replace already existing content on the page. I originally made it so that it was just click on the span change1 class and it changed to page1.html, span change2 class and it changed to page2.html, eventually this would get a mess since I was adding a new function for each page. So I decided to try and set up a loop, it all seems to work apart from it's not display Page 1 ~ 5, rather Page 6, and only Page 6. I was wondering if someone could take a look at it and tell me any errors they spot :v:
[url]http://pastebin.com/EA8fHG4F[/url]
I know it's going to be something very obvious and simple I've missed and I'll feel like a dumbass afterwards.[/QUOTE]
You're attempting to have a for loop continue out of the tags. You have to close the for loop as you before the end of the tag, and make another loop for the other part. I guess
Also, I smell w3schools
[code]{
document.write("<span class=" + i);
document.write("><font color=#FF0000><b>Page " + i);
document.write("</b></font></span> | ");
}[/code]
[editline]Still don't like the looks of the code, but I don't want to comment on it. I'll leave that to someone else.[/editline]
[code]<script type="text/javascript">
$(document).ready(function() {
$("span").click(function(){
$("p.1").load('pages/page' + $(this).attr('className') + '.html');
});
$("img.games").click(function(){
$("p.1").load('games.html');
$("div.pages").hide();
});
$("img.blog").click(function(){
$("p.1").load('pages/page1.html');
$("div.pages").show();
});
});
</script>[/code]
Eeh, works.
So I made this game that I want people to download from my website (because that's the only way to get paid from it... i'm not selling it, just banking with ads)
My cousins have said: "we already told all our friends, they're playing it everyday at school!"
Me: "Well bro, why don't I see the downloads going up?"
SO. what I'm thinking is this. Somehow I need to have a hidden data value somewhere that indicates the IP of the computer the game was downloaded on.. i'm sorry, i meant IP of the network.
Then when the game runs, (if it can connect to the net) it will check the IP of the player... if it matches, it will play, if it doesn't match, it will say "you need to download it from the site asshole, instead of passing it around on a USB".... if there is no internet connection then it will just play. (the thing is, people wont realize that web connection is needed ... well, not right away ... most kids are constantly connected to the internet, i mean, who ever turns off their modem?)
my question is. can i insert a dynamic file into the .zip folder that is being downloaded?
I'm using PHP. So, any help?
Sorry, you need to Log In to post a reply to this thread.