Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 JS Question - JS to tell page what image to show
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

redbrad0
Advanced Member

USA
3725 Posts

Posted - 16 May 2004 :  18:03:18  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I am trying to write something in JS where JS calls a outside page that generates the image to be displayed. Basically I was trying to set the image by..


document.ActivePooling.src = 'active_pull.asp?topics=&unique='+unique ;


Where when active_pull.asp runs some ASP script and then forwards to a image file for the JS script to use. For some reason it never sets the image. Does anyone have any suggestions?


Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 17 May 2004 :  05:59:37  Show Profile
are you setting the correct content type in active_pull.asp?

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 17 May 2004 :  09:15:05  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I thought I would not need to set it if I am just FWD to a image? So I will put in the content settings and then FWD to the image?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 17 May 2004 :  10:59:59  Show Profile
Are you just trying to response.redirect to the image?

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 17 May 2004 :  16:20:27  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Yep thats what the active_pull.asp page does, if it meets variable X then response.redirect "image1.gif" else response.redirect "image2.gif"

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 18 May 2004 :  09:39:15  Show Profile
I don't think that is possible, you would have to write the image and set the content type.
If your server has .NET installed you can do this easily with
Response.ContentType = "image/gif";
			Response.WriteFile("image2.gif");

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 18 May 2004 :  16:27:29  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Will try that when I get home, thanks David will keep you updated

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 18 May 2004 :  22:05:47  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
I have .net installed but really want this done in ASP as its for Snitz Forums

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 19 May 2004 :  06:57:03  Show Profile
I've only done it in ASP using VB Components to change the image into binary format then
Set object = server.createobject("myobject.imagestuff")
Response.ContentType = "image/gif"
Response.BinaryWrite(object.binaryimage())


I'm not entirely sure you can do it purely in ASP

The UK MkIVs Forum

Edited by - DavidRhodes on 19 May 2004 06:57:46
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 19 May 2004 :  21:44:33  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
What if you open the image just like you do a text file to read it?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 20 May 2004 :  04:24:45  Show Profile
Actually, it must be possible using ASP only as the "gallery mod" uses pure ASP to upload files. It'd be worth you looking at that code to see how it works

The UK MkIVs Forum
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 20 May 2004 :  20:08:56  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
well its not needing to upload a image.

basically here is the deal (and i have pages done is php that do this)
page A has JS running that calls page B (asp page) to run a query. This query then needs to return the results to page A so page A can figure out if there is anything it needs to do. The way I was thinking is setting a image on page A to a different image that has a different size which the Js on page A can then check the image size to see if the script needs to run. Does this make since?

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 21 May 2004 :  04:21:46  Show Profile
quote:
Originally posted by redbrad0

well its not needing to upload a image.



I know but the image upload convert files to binary format, that the bit of code you need. Then you can use Response.BinaryWrite

The UK MkIVs Forum
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.37 seconds. Powered By: Snitz Forums 2000 Version 3.4.07