Click here to Skip to main content
15,905,679 members
Home / Discussions / Web Development
   

Web Development

 
Questionadding additional security to website Pin
bankerkev20-Sep-06 16:42
bankerkev20-Sep-06 16:42 
AnswerRe: adding additional security to website Pin
Christian Graus20-Sep-06 16:55
protectorChristian Graus20-Sep-06 16:55 
QuestionProblem on HttpApplicationState.Item Pin
walalawll20-Sep-06 16:34
walalawll20-Sep-06 16:34 
Questionproblem storing value correct way in database Pin
uglyeyes20-Sep-06 14:02
uglyeyes20-Sep-06 14:02 
AnswerRe: problem storing value correct way in database Pin
Stephan Pilz20-Sep-06 21:13
Stephan Pilz20-Sep-06 21:13 
GeneralRe: problem storing value correct way in database Pin
uglyeyes21-Sep-06 13:59
uglyeyes21-Sep-06 13:59 
GeneralRe: problem storing value correct way in database Pin
Stephan Pilz21-Sep-06 20:38
Stephan Pilz21-Sep-06 20:38 
QuestionLoading images using Javascript [modified] Pin
jszpila20-Sep-06 11:41
jszpila20-Sep-06 11:41 
Hey All,
I'm having a bit of a problem with loading some images using javascript. What I'm trying to do is parse out a query string value, and load an image using that value.

For instance, if someone went to:
http://www.mydomain.com?person=JohnDoe

It would parse out the name from the query string and load JohnDoe.gif into a image named portrait and write a cookie with that information; if there were no query string value, it would would load a default image. Now, this works in Firefox, but not IE; IE just results in that irritating little red "X" broken image box.

My Javascript:
========================
//get name from GET string
function GetName(CookieKey)
{
//try to read the key "name" value from cookie
var personalimg = readCookie('name')

if (personalimg) //if the cookie exists, load the image with the same name
{
//this appears to be the part that isn't working in IE only (firefox is fine)
//I have checked the image paths and the files do exist
document.contact.src="./images/people/" + personalimg + "Contact.gif";
}
else // if no cookie, check for name in query string or load default image
{
var query = window.location.search.substring(1);
var pair = query.split("=");

//if the cookie contains the key name, load it's value into the image
if (pair[0] == CookieKey)
{
document.contact.src="./images/people/" + pair[1] + "Contact.gif";
document.cookie = "name=" + pair[1] + ";"
}
else //load default image
{
document.contact.src = "./images/Contact.gif";
}
}
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

==================
My HTML:
==================

<img src="javascript:GetName('name')" name="contact" />

Note that I don't use Javascript too often so any suggestions on how to improve this would be much appreciated, as is any other help.
Thanks in advance!

-------------------
abort, retry, fail?
QuestionVisable/Invisable tr in Java script Pin
Jesu.Official20-Sep-06 3:41
Jesu.Official20-Sep-06 3:41 
AnswerRe: Visable/Invisable tr in Java script Pin
_AK_20-Sep-06 4:04
_AK_20-Sep-06 4:04 
AnswerRe: Visable/Invisable tr in Java script Pin
Guffa20-Sep-06 22:20
Guffa20-Sep-06 22:20 
QuestionPop-up Blocker Pin
Monin D.20-Sep-06 0:09
Monin D.20-Sep-06 0:09 
AnswerRe: Pop-up Blocker Pin
JUNEYT20-Sep-06 2:44
JUNEYT20-Sep-06 2:44 
GeneralRe: Pop-up Blocker Pin
Monin D.20-Sep-06 5:06
Monin D.20-Sep-06 5:06 
Question[Message Deleted] Pin
PREMSONBABY19-Sep-06 22:41
PREMSONBABY19-Sep-06 22:41 
AnswerRe: Need javascript Pin
Guffa20-Sep-06 3:15
Guffa20-Sep-06 3:15 
AnswerRe: Need javascript Pin
Monin D.20-Sep-06 5:10
Monin D.20-Sep-06 5:10 
QuestionQuestion about calling SAPI from javascript. Pin
rryyjw19-Sep-06 22:04
rryyjw19-Sep-06 22:04 
QuestionFile upload filename Pin
DagsmanIsTheMan19-Sep-06 21:32
DagsmanIsTheMan19-Sep-06 21:32 
AnswerRe: File upload filename Pin
DagsmanIsTheMan19-Sep-06 21:36
DagsmanIsTheMan19-Sep-06 21:36 
QuestionMaintaing View State in Client Control Pin
Jesu.Official19-Sep-06 21:07
Jesu.Official19-Sep-06 21:07 
AnswerRe: Maintaing View State in Client Control Pin
Stephan Pilz20-Sep-06 21:22
Stephan Pilz20-Sep-06 21:22 
AnswerRe: Maintaing View State in Client Control Pin
Exelioindia27-Sep-06 1:05
Exelioindia27-Sep-06 1:05 
QuestionPhp help Pin
rhys10019-Sep-06 16:43
rhys10019-Sep-06 16:43 
GeneralPersonalize your google home page [modified] Pin
Raj Lal19-Sep-06 11:45
professionalRaj Lal19-Sep-06 11:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.