Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
[QUOTE=Trivkz;33171802]So, would something like SimpleXML do?[/QUOTE]
Yep, I haven't used it that much (thankfully, bloody XML), but it should be enough to fit your needs.
"You have red on your XML."
Not sure if this is the right place to post this question, but here goes.
I want to buy a specific domain name. It seems the domain is owned by DomainBrokers.com
In order to purchase the domain name that I want I have to 'make them an offer'.
Legit or shit?
Can someone test my website in IE 8 or earlier? I need to see if my redirect works but i cant install IE 8 on windows 7. I just want to know if the page redirects if its opened in IE 8 or earlier.
Here's a web dev's best friend when it comes to IE! [url]http://www.my-debugbar.com/wiki/IETester/HomePage[/url]
or [url]https://browserlab.adobe.com/[/url]
for almost all the browser except opera
I know that in PHP it's possible to do something like
[code]<?php
if (thisIsTrue()):
?>
<a> then show this HTML
<?end if;?>[/code]
// i might have syntax wrong... as a matter of fact, I know I do
I know that's more effecient than doing
[code]<?php
if (thisIsTrue())
{
echo "<a> then show this HTML";
}
?>[/code]
My situation is that I have a page that can display multiple types of displays. (I'm trying to do MVC... i think?)
But isn't MVC impossible when using that first display technique to display HTML?
[QUOTE=zzlawlzz;33175966]or [url]https://browserlab.adobe.com/[/url]
for almost all the browser except opera[/QUOTE]
Pretty sure TopStyle lets you preview your code in any browser installed on your PC.
[QUOTE=Sprite;33180048]I know that in PHP it's possible to do something like
[code]<?php
if (thisIsTrue()):
?>
<a> then show this HTML
<?end if;?>[/code]
// i might have syntax wrong... as a matter of fact, I know I do
I know that's more effecient than doing
[code]<?php
if (thisIsTrue())
{
echo "<a> then show this HTML";
}
?>[/code]
My situation is that I have a page that can display multiple types of displays. (I'm trying to do MVC... i think?)
But isn't MVC impossible when using that first display technique to display HTML?[/QUOTE]I don't see how those would affect the MVC-ness of it? Usually the first style is used in views.
[QUOTE=zman115;33175830]Can someone test my website in IE 8 or earlier? I need to see if my redirect works but i cant install IE 8 on windows 7. I just want to know if the page redirects if its opened in IE 8 or earlier.[/QUOTE]
What jay recommended, and you can also press F12 on the latest IE version to access the developer tools, which among other things let you change to IE7 or IE8 mode.
[QUOTE=StinkyJoe;33186332]What jay recommended, and [B]you can also press F12 on the latest IE version to access the developer tools, which among other things let you change to IE7 or IE8 mode.[/B][/QUOTE]
Super useful tip there.
[QUOTE=Sprite;33180048]I know that in PHP it's possible to do something like
[code]<?php
if (thisIsTrue()):
?>
<a> then show this HTML
<?end if;?>[/code]
// i might have syntax wrong... as a matter of fact, I know I do
I know that's more effecient than doing
[code]<?php
if (thisIsTrue())
{
echo "<a> then show this HTML";
}
?>[/code]
My situation is that I have a page that can display multiple types of displays. (I'm trying to do MVC... i think?)
But isn't MVC impossible when using that first display technique to display HTML?[/QUOTE]
That's a pretty wonky grasp of the MVC paradigm. Here's a tip: true MVC is nigh impossible on the web, most frameworks don't implement it correctly at all, and even those that try to stick closely to the paradigm have to make some sacrifices (RMR seems like a better alternative, if anyone's interest). I guess my point is that there's a lot of misinformation on the subject and a lot of personal choices being passed around as fact, and it's in your best interest to be wary of this.
As for your example, that has nothing to do with MVC, at all. However, I strongly recommend your first option - your second option is what I call horrible code. It mostly boils down to a choice between the use of echo statements as opposed to breaking in and out of the PHP interpreter - the speed difference between both is next to none, but the latter is much more readable, not only because it can be properly structured like the HTML around it, but because editors will not pick up and highlight the HTML inside strings. PHP short syntax is also super useful for this:
[php]
<? if($foo > 10): ?>
<strong>Foo is greater then 10 :)</strong>
<? foreach($bar as $woo): ?>
<div class="<?= $woo ?>">
<?= $woo ?>
</div>
<? endforeach ?>
<? else: ?>
<strong class="fail">Foo is <span class="count"><?= $foo ?></span></strong>
<? endif ?>
[/php]
Isn't that much neater?
- snip -
[code]<div style="width:600px;">
<pre>
Super long text that is longer than 600px and doesn't get word wrapped in google chrome
</pre>
</div>[/code]
what do? why does <pre> cause this? am i going to seriously have to use <br>s?
[QUOTE=Sprite;33197652][code]<div style="width:600px;">
<pre>
Super long text that is longer than 600px and doesn't get word wrapped in google chrome
</pre>
</div>[/code]
what do? why does <pre> cause this? am i going to seriously have to use <br>s?[/QUOTE]
Pre means preformatted text, if you put your content as a huge long line, that's how it'll display.
Use <p> instead.
turned into a super block post
fortunately notepad++ had the ability to do str_replace with \n (converting it to <br>), so my life is good for this.
Hi Facepunch! If anybody had the time, could someone explain me how to have a video player on my web page?
[QUOTE=TheBandman;33202483]Hi Facepunch! If anybody had the time, could someone explain me how to have a video player on my web page?[/QUOTE]
What kind? If it's just youtube it's as simple as copying a link.
[QUOTE=mobrockers2;33202507]What kind? If it's just youtube it's as simple as copying a link.[/QUOTE]
It currently has to use a youtube external link in order for people to be able to post their videos into my page. What I wanted to do was avoid using YouTube and a way to post videos directly
[QUOTE=TheBandman;33202552]It currently has to use a youtube external link in order for people to be able to post their videos into my page. What I wanted to do was avoid using YouTube and a way to post videos directly[/QUOTE]
<video>?
And you need an upload script for your preferred backend.
So why am I using an MVC structure over simply using different types of pages?
What are the advantages again?
[QUOTE=Sprite;33214835]So why am I using an MVC structure over simply using different types of pages?
What are the advantages again?[/QUOTE]
I use it because it allows me to make different styles faster.
[QUOTE=Sprite;33214835]So why am I using an MVC structure over simply using different types of pages?
What are the advantages again?[/QUOTE]
It's a concept called [url=http://en.wikipedia.org/wiki/Separation_of_concerns]Separation of concerns[/url]
question
Is there a way I can use a special font instead of the standard fonts?
I want to give my site some life.
[QUOTE=Sprite;33231492]question
Is there a way I can use a special font instead of the standard fonts?
I want to give my site some life.[/QUOTE]
Don't think that works for people that don't have that font installed, so you can do it the normal way, install the font and use it like any other font in your css, but have other fonts defined as well to fall back on when a client doesn't have that font. Correct me if horribly wrong.
[QUOTE=Sprite;33231492]question
Is there a way I can use a special font instead of the standard fonts?
I want to give my site some life.[/QUOTE]
@font-face
[QUOTE=iamacyborg;33231623]@font-face[/QUOTE]
but where do I store the fonts?
on my website?
do i link to them like i would link to an image?
[editline]11th November 2011[/editline]
[QUOTE=mobrockers2;33231530]Don't think that works for people that don't have that font installed, so you can do it the normal way, install the font and use it like any other font in your css, but have other fonts defined as well to fall back on when a client doesn't have that font. Correct me if horribly wrong.[/QUOTE]
DAMN!
I find it slightly odd that such a functionality is not available.
I mean.... texts is a lot of the internet, last time i checked.
[QUOTE=Sprite;33231635]but where do I store the fonts?
on my website?
do i link to them like i would link to an image?
[editline]11th November 2011[/editline]
DAMN!
I find it slightly odd that such a functionality is not available.
I mean.... texts is a lot of the internet, last time i checked.[/QUOTE]
If your fonts are here use this (here google stores the fonts so you don't need them on your website)
[url]http://www.google.com/webfonts[/url]
if they aren't then try this.... (This will require the fonts to be uploaded to your website)
[url]http://www.fontsquirrel.com/fontface/generator[/url]
I have issues with fonts myself But I think I have everything figured out, If you need any help with anything please say so and remember to be descriptive!
I was wandering what is the best way to go about making a website where all pages have the same general layout. The obvious thing to do would be copy the html over to all the other pages, but then if/when i wanted to change how the website looked i would have to go change it on ever single page. So what is the best way to do this?
[QUOTE=MayorBee;33236717]I was wandering what is the best way to go about making a website where all pages have the same general layout. The obvious thing to do would be copy the html over to all the other pages, but then if/when i wanted to change how the website looked i would have to go change it on ever single page. So what is the best way to do this?[/QUOTE]
use a templating language. PHP (yuck) can do it easily, otherwise [url=http://jekyllrb.com/]Jekyll[/url] is kickin' rad.
Sorry, you need to Log In to post a reply to this thread.