• Welcome to Dark Bit Factory & Gravity.
 

Javascript Idea

Started by Shockwave, July 17, 2009

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Shockwave

I had an idea for the front page, I don't know if it will work to be honest with you. I was reading some reference manuals, I must admit that I am not great at Javascript, I know enough to do button rollovers and validate forms but that's about all, but I was reading about the DOM and thought that maybe I can process all the links on the front page when it loads.

Why would I do this?

Well I was thinking that I could use Javascript to put a little preview box up when you move your mouse over a link... This would display a fair bit of text from the page, it may work, it may not, do you think it would be too distracting and secondly does anyone actually turn off javascript these days?
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

I don't know anyone who disables javascript.  It's integral to the way so many web pages work.
I've done a lot of javascript recently and always use jQuery to do any html/xml dom manipulation.  First of all because it removes any cross-browser problems and second because it's very easy to use.  There are some good ui plugins for it too.

Jim
Challenge Trophies Won:

benny!

I agree with Jim, that most ppl have enabled Javascript nowadays. Just look at
all the Google libraries - they are nearly using javascript.

jQuery is definately one of the best JS-lib around. And I bet there is such a plugin
for it which previews the page. Just extracting bits of the page might require some
additional work (AJAX usage) but could be done, too of course.

Personally, I am not the fan of those preview tooltips tbh. But if the majority would
like to see it, I offer my help of course to implement it.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

I did some tests this morning and wrote a script that did it... It would be a bit obtrusive, there are a lot of links on the front page....
Shockwave ^ Codigos
Challenge Trophies Won:

combatking0

You could delay the action such that it appears after 5 seconds if the cursor is held over the link and not removed.

I'd be interested in helping with this, as I'm working on an AJAX based site at the moment. Adding a preview window to the links page would be a bonus.
You are our 9001st visitor.
Challenge Trophies Won:

Shockwave

Cheers Tony, I actually have the script coded and working now, it's on the other computer though, I'll post it here if you want it?
Shockwave ^ Codigos
Challenge Trophies Won:

combatking0

Yes please.

I'm not sure if it is widely documented, but there is a problem with memory usage when using AJAX on an IE7 browser. I'll post the remedy if you haven't heard of this.
You are our 9001st visitor.
Challenge Trophies Won:

benny!

Quote from: combatking0 on July 19, 2009
...
I'm not sure if it is widely documented, but there is a problem with memory usage when using AJAX on an IE7 browser. I'll post the remedy if you haven't heard of this.

That would be really interesting to know. Please post more information about
that. I only know about bad memory handling on the IE6 - but never heard
anything about IE7 (although it wouldnt be a wonder for me ;-) )
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

slinks

Quote from: Shockwave on July 17, 2009
maybe I can process all the links on the front page when it loads.

While I don't pretend to be an expert on such matters, would this not result in horrific loading times for people without ultra-fast broadband, such as loopy, who when I last checked was running dial-up, and myself who is using 'barely broadband'?
I love semi-colons way too much ^^;
Challenge Trophies Won:

Jim

QuoteSay NO to IE
The web page/javascript debugger in IE8 is great, better than Firebug I think.

Jim
Challenge Trophies Won:

Shockwave

Quote from: slinks on July 19, 2009
While I don't pretend to be an expert on such matters, would this not result in horrific loading times for people without ultra-fast broadband, such as loopy, who when I last checked was running dial-up, and myself who is using 'barely broadband'?

Probably wouldnt hurt it, it's just text mate.

Quote from: Jim on July 19, 2009
QuoteSay NO to IE
The web page/javascript debugger in IE8 is great, better than Firebug I think.

Jim


The only thing I like about IE is the way it renders text, apart from that it fails in so many ways to follow standards that I hate it, good debugger or not... A plus point is that it's an opportunity for web developers to make serious cash (hacking otherwise perfectly written sites to display in their deliberately uncompliant browser).
Shockwave ^ Codigos
Challenge Trophies Won:

Yaloopy

Quote from: slinks on July 19, 2009
While I don't pretend to be an expert on such matters, would this not result in horrific loading times for people without ultra-fast broadband, such as loopy, who when I last checked was running dial-up, and myself who is using 'barely broadband'?
No, no, no. We've had overpriced, laggy, shit 100KB/s broadband that they advertise as 2MB for a couple of years here now.
Fuck L. Ron Hubbard and fuck all his clones.
Challenge Trophies Won:

combatking0

Here is the fix:

window.onunload=function(){
delete(xmlHttp.request);
}


Assuming "xmlHttp.request" is the name of the object you have used to request the xml/html/data, and that it is global. It could work if the object is defined within a global object, but not if the request object is defined within a global function.

I don't know if the bug affects IE8 or not.
You are our 9001st visitor.
Challenge Trophies Won:

benny!

[OT]
Just tested IE8. The developer tool is a huge step forward.
You can even easily switch between IE7 and IE8. That's
indeed what I call a progress. On the other hand - for such
a big product - it is a shame that such a tool is available just
yet - and not years ago...

Nevertheless, I do not like the IE browser itself.
[/OT]
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

combatking0

#15
Here is an alternate fix:

<div style="color:#ff0000;">This site is best viewed under the latest version of the FireFox browser, or any other standards compliant browser.<br />

Users of Internet Explorer may experience minor problems such as slow-down and lack of memory. Their computers may also be affected.</div>


You are our 9001st visitor.
Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

benny!

Sorry, couldnt resist:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Wrong browser</title>
<script type="text/javascript">
function blink()
{
var guru = document.getElementById('guru');
if (guru)
{
if ( "guru blinkOn" == guru.className )
{
guru.className = "guru blinkOff";
}
else
{
guru.className = "guru blinkOn";
}
}

setTimeout(blink, 1000);
}
</script>
<style>
body
{
background-color: #000;
color: #f00;
font-weight: bold;
font-family: Courier;
}

.blinkOn
{
border-color: #f00;
}

.blinkOff
{
border-color: #000;
}

.guru
{
margin: 0 auto 0 auto;
padding: 0;
border-width: 6px;
border-style: solid;
width: 640px;
}
.guru p
{
margin: 0;
padding: 6px 0 6px 0;
line-height: 20px;
text-align: center;
}
</style>
</head>
<body onload="setTimeout(blink, 1000);">
<div id="guru" class="guru">
<p>
Software Failure.  Please use another browser and continue.<br />
Guru Meditation #0000404.0000080t
</p>
</div>
</body>
</html>

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

combatking0

lol. I get the same message in FF3 and IE7.

Which browser is the "right" one?
You are our 9001st visitor.
Challenge Trophies Won:

benny!

Quote from: combatking0 on July 21, 2009
lol. I get the same message in FF3 and IE7.

Which browser is the "right" one?

Of course this code should be wrapped in something like:


<!--[if IE 6]>
<![endif]-->


;)
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: