Web design question

wehaveitall
Posts: 1097
Joined: Fri Jun 22, 2007 12:40 am

Web design question

Post by wehaveitall » Sun Aug 31, 2008 1:44 am

I just wanted to know, what is the code required to make the download link different depending on the browser your using, and how would you add text images, etc, depending on the browser?

logicman
Posts: 378
Joined: Sat Jun 28, 2008 12:58 am

web design help.

Post by logicman » Sun Aug 31, 2008 3:02 am

I hope these sites help to put you on the right track, wehaveitall.

http://htmlhelp.com/
http://www.anybrowser.org/campaign/

Stay safe! :-)
(Note to self: must change sig before it gets too boring.) :-)

wehaveitall
Posts: 1097
Joined: Fri Jun 22, 2007 12:40 am

umm

Post by wehaveitall » Sun Aug 31, 2008 3:29 pm

Logicman,
I'm not mad at you or anything, but I tried both of those links, and here's the problem.

Anybrowser is a website to try and make whatever browsing you're using show the same content as any other browser. What I'm looking for is how to for example say if they are using internet explorer, "This site can easily be viewed in firefox, and it is reccomended you switch to firefox."
And if they are using firefox: Good job, we have detected you're using firefox.

Htmlhelp-this is a javascript command, not html, and so I couldn't find it here.

Thanks for trying though, I do appreciate it.

Could Sami or Esa, Deborah, or Timo give me any suggestions?

Like for example, on the download page, if you're using firefox it says Download for firefox, where as if you use i explorer, it says download for i explorer.

Sami
Posts: 6987
Joined: Sat Oct 07, 2006 11:43 am

Re: umm

Post by Sami » Sun Aug 31, 2008 4:02 pm

Well, you'll need to use either JavaScript to detect the browser and then do whatever you want to the document, or you can create your pages dynamically on the server side based on the User-Agent header in the HTTP request. Our site uses both approaches.

If you're stuck with static HTML, you can still have different content show up for Internet Explorer users by using conditional comments.

For anything more complicated, perhaps jQuery would be the easiest way to go. Let's say you have the following elements in your HTML document:

Code: Select all

<div id="ie" style="display: none;">
&nbsp;&nbsp;You're using Internet Explorer.
</div>

Code: Select all

<div id="firefox" style="display: none;">
&nbsp;&nbsp;You're using Firefox.
</div>

You can then add something like this to make one of the elements visible based on which browser the visitor is using:

Code: Select all

<script type="text/javascript">
&nbsp;&nbsp;if ($.browser.msie) {
&nbsp;&nbsp;&nbsp;&nbsp;$("#ie").show();
&nbsp;&nbsp;} else if ($.browser.mozilla) {
&nbsp;&nbsp;&nbsp;&nbsp;$("#firefox").show();
&nbsp;&nbsp;}
</script>

Of course, you'll need to add jQuery to your page before this script, but I'll leave that as an exercise to you.

logicman
Posts: 378
Joined: Sat Jun 28, 2008 12:58 am

No problem. :-)

Post by logicman » Sun Aug 31, 2008 4:31 pm

No worries, wehaveitall.

1 I mis-understood your purpose.
2 I can't know everything.
3 It was 4am here and I was tired.
4 The dog was barking and distracting me.
5 My computer hates me.
6 I'll stop right there - I have a reputation to maintain.

Seriously - thank you for your very polite reply. :-)

wehaveitall
Posts: 1097
Joined: Fri Jun 22, 2007 12:40 am

Im confused -_-

Post by wehaveitall » Sun Aug 31, 2008 6:10 pm

I added the src to the js file of the jquery thingy, and I added your codes. The code seems like it would work, so I might be doing something wrong. Idk. Here's what I have: http://wehaveitall.net/jcode.html

Here's what the page looks like: http://wehaveitall.net/testhomepage.html

(the flash menus are not included in it right now)

I gave the table where the code is a border so you can see it.

Any suggestions would be great.

MysteryFCM
Posts: 4912
Joined: Mon Jul 14, 2008 4:47 pm

Hang on .......

Post by MysteryFCM » Sun Aug 31, 2008 6:16 pm

" What I'm looking for is how to for example say if they are using internet explorer, "This site can easily be viewed in firefox, and it is reccomended you switch to firefox.""

You're looking for a way to alienate your visitors? I'm guessing you haven't realised that all this would do, is send those of us that;

1. Don't want to use Firefox
2. Don't want to be FORCED to use Firefox
3. Believe we should keep our choice

... away from your site - and looking at your test homepage, you're going to do that anyway. You've got an annoying animated cursor that serves absolutely no purpose, unless you're a 5 year old, and thats just for starters.

The next thing you're doing wrong is using paths such as the following;

file:///F|/stuff/Wehaveitall!/displayFlashnetmain

Do you actually want anyone other than yourself, using that specific computer, to be able to view your content? Unless the site is hosted on the same machine you are using to create the site, you CANNOT use those paths - you MUST use the path that points to the actual content on your site. For example;

src="/display/Flashnetmain"

Where /display is a folder, and Flashnetmain is the file to be used.

Sami
Posts: 6987
Joined: Sat Oct 07, 2006 11:43 am

Re: Im confused

Post by Sami » Sun Aug 31, 2008 6:44 pm

My bad,

Code: Select all

#
was missing from the selectors. I didn't say this was tested code, did I? :)

wehaveitall
Posts: 1097
Joined: Fri Jun 22, 2007 12:40 am

Gee thanks for your nice critism (sarcastic)

Post by wehaveitall » Sun Aug 31, 2008 7:39 pm

MysteryFCM,
First off, I get 600+ views a month, so you can't say my website is terrible. Obviously some people like it.
The fact that people like you spend your time in the wot forum criticizing people for something they worked hard on is insulting. Constructive criticism I'm okay with like if you said, "The cursor kind of gets in the way. Maybe you should consider removing it", but simply insulting my site when I SPECIFICALLY ASKED FOR AN ANSWER FROM SAMI, TIMO, ESA, OR DEBORAH ONLY, is worse. I said quote, "Could Sami or Esa, Deborah, or Timo give me any suggestions?" I never said could mysteryfcm give me suggestions.

My site is for kids, and I AM A KID. I was very proud of myself when I got the cursor thing running, and I've asked many people of the ages of 10, 11, and 12 and even ADULTS, all of which HAVE SPECIFICALLY COMPLIMENTED THE CURSOR. In fact, in my feedback form, one person wrote their favorite thing was the cursor trail.

Let me explain something to you. Not EVERYONE uses wot. And many people use old versions of internet explorer. Internet explorer, especially old versions, are not very secure. Firefox scans downloads, analyzes page contents, etc. I was thinking that if someone came on my site using I explorer, I could simply say, "Everything on this site works the same with firefox as it does in I explorer. Firefox is another browser, like IE, however it is more secure. It is recommended you get firefox. You can download it at: Firefox.com
So I wasn't going to block them or anything. And just so you know, it's my site, so I can do what I want.

As for the file paths, I am already aware of this. That was a test a while ago, and I already removed it on the main index page, however I haven't published it yet. This page is like an experimental home page, and I made it BEFORE I erased the incorrect path.

So think next time you say things like, "I'm guessing you haven't realised that all this would do, is send those of us that;
1. Don't want to use Firefox etc etc
.. away from your site - and looking at your test homepage, you're going to do that anyway."
And then go on to continue criticizing my site, by saying: "You've got an annoying animated cursor that serves absolutely no purpose, unless you're a 5 year old, and thats just for starters."

So stop your crap. No one likes it.

wehaveitall
Posts: 1097
Joined: Fri Jun 22, 2007 12:40 am

Lol, we're almost there Sami

Post by wehaveitall » Sun Aug 31, 2008 7:52 pm

Lol, okay thank you very much for all your hard work, but I got one other problem lol. Firefox works. If I use firefox, it says you are using firefox. But for ie, nothing happens. Any ideas?

EDIT: Resolved, It was my fault sorry. The active x control blocker thingy was messing it up. No more problems now. Thank you SO MUCH Sami, I've looked all over the internet for a solution to this. Would it be possible for me to post this on my website if I give you credit? I haven't been able to find a code that does this and works anywhere on the internet,

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest