Toon posts:

van javascript naar asp

Pagina: 1
Acties:
  • 40 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb al hard zitten zoeken voor grotendeels van een javascript naar asp te converteren, maar deze vind ik niet.

request.getSession( true ).setAttribute( "continent", action )

En over deze ben ik het niet zeker of deze nu letterlijk mag overgenomen worden of niet.
document.inputForm.action.value = anAction


Alvast hartelijk bedankt voor jullie hulp

  • Willem
  • Registratie: Februari 2001
  • Laatst online: 01:42
Wat wil je van JavaScript naar ASP converteren en waarom ?

Motor (of auto) onderhoud bijhouden


Verwijderd

Topicstarter
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/ie.css.txt" type="text/css" rel="stylesheet">
</head>


<script language="JavaScript1.3">

function setAction( anAction ){
document.inputForm.action.value = anAction;
}

function submitInputForm(){
alert( "submitting: " + document.inputForm.action.value );
document.inputForm.submit();
}

</script>

<body>

<%
String action = request.getParameter( "action" );
if( ( action.equals( "goEurope" ) ) || ( action.equals( "goAmerika" ) ) ||
( action.equals( "goOce" ) ) || ( action.equals( "goAzi" ) ) ||
( action.equals( "goAnt" ) ) ) {
request.getSession( true ).setAttribute( "continent", action );
}

%>

<%= request.getParameter( "action" ) %>
<%= request.getSession(true).getAttribute( "continent" ) %>

<form name="inputForm" method = "post" action="./Wereld1.jsp">
<input type="hidden" name="action" value="" >
<table class="TABLE.Contour" width="100%" border="1">
<tr>
<td><table width="100%" border="0">
<tr>
<td><a href="#" onClick="setAction('goEurope');submitInputForm()">
<% if( request.getSession(true).getAttribute( "continent" ).equals( "goEurope" ) ) { %>
[img]"img/europ2.gif">[/img]
[img]"img/europ1.gif"[/img]
<% } %>
</a>
</td>
<td><a href="#" onClick="setAction('goAmerika');submitInputForm()">
<% if( request.getSession(true).getAttribute( "continent" ).equals( "goAmerika" ) ) { %>
[img]"img/amerika2.gif">[/img]
[img]"img/amerika1.gif"[/img]
<% } %>
</a></td>
<td><a href="#" onClick="setAction('goOce');submitInputForm()">[img]"img/oce1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAfrika');submitInputForm()">[img]"img/afrika1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAzi');submitInputForm()">[img]"img/azi1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAnt');submitInputForm()">[img]"img/ant1.gif"></a></td>[/img]
</table>
<input type="button" name="ok" value="ok" onClick="setAction('ok');submitInputForm()">
<input type="button" name="cancel" value="cancel" onClick="setAction('cancel');submitInputForm()">

<p>  </p>
</form>

</body>
</html>
Dit is voor te converteren naar asp, ik heb al
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<! -- #include file = "code.inc"-->
</head>

<body>

<%
String action = request.getParameter( "action" )
if action = "goEurope" or action = "goAmerika" or _
action = "goOce" or action.equals = "goAzi" or _
action = "goAnt" then
request.getSession( true ).setAttribute( "continent", action )
end if

%>

<%= request.getParameter( "action" ) %>
<%= request.getSession(true).getAttribute( "continent" ) %>


<input type="hidden" name="action" value="" >
<table class="TABLE.Contour" width="100%" border="1">
<tr>
<td><table width="100%" border="0">
<tr>
<td><a href="#" onClick="setAction('goEurope');submitInputForm()">
<% if request.getSession(true).getAttribute( "continent" ) = goEurope then %>
[img]"img/europ2.gif">[/img]
[img]"img/europ1.gif"[/img]
<% end if %>
</a>
</td>
<td><a href="#" onClick="setAction('goAmerika');submitInputForm()">
<% if request.getSession(true).getAttribute( "continent" ) = goAmerika then %>
[img]"img/amerika2.gif">[/img]
[img]"img/amerika1.gif"[/img]
<% end if %>
</a></td>
<td><a href="#" onClick="setAction('goOce');submitInputForm()">[img]"img/oce1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAfrika');submitInputForm()">[img]"img/afrika1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAzi');submitInputForm()">[img]"img/azi1.gif"></a></td>[/img]<a href="#" onClick="setAction('goAnt');submitInputForm()">[img]"img/ant1.gif"></a></td>[/img]
</table>
</td>
</tr>
<tr>
<table width="100%" border="1">
Set FS = Server.CreateObject("Scripting.FileSystemObject")
Set RS = FS.OpenTextFile(Server.MapPath("landen.txt"))
While not rs.AtEndOfStream
%> <tr><td><INPUT type="checkbox" id=<%response.write RS.readline %>1 name=<%response.write RS.readline %>1> </td>
<td><INPUT type="checkbox" id=<%response.write RS.readline %>2 name=<%response.write RS.readline %>1></td><td><%Response.Write RS.ReadLine
Response.Write(" <td /><tr />")
Wend %>
</body>
</html>
Dit is de code die ik er van gemaakt heb.

De bedoeling is dat ik later, door te klikken op een picture in het hoofd menu, een pagina krijg, met allemaal landen van dat wereld deel. Maar zover ben ik nog niet. Eerst moet ik mijn grote vertaalfouten uit mijn code halen. En ook mijn typ fouten.

Maar als jullie mij al die twee codes geven, van hierboven, ben ik al tevreden.
Je mag meer doen ze, maar ik ben al heel tevreden met die twee codes.
alvast hartelijk bedankt


in mijn code.inc staat
<script language="VBScript">

sub setAction( anAction )
document.inputForm.action.value = anAction
end sub

sub submitInputForm()
alert( "submitting: " + document.inputForm.action.value )
document.inputForm.submit()
end sub

[ Voor 27% gewijzigd door Verwijderd op 06-02-2003 11:10 ]


  • SH007
  • Registratie: November 2001
  • Niet online
Software Algemeen -> Programming & Webscripting

[ Voor 57% gewijzigd door SH007 op 06-02-2003 11:45 . Reden: beter lezen ]


  • whoami
  • Registratie: December 2000
  • Laatst online: 24-08 16:37
Javascript is clientside
ASP is een serverside techniek van programmeren.

Waarom je dat dus wilt converteren ontgaat me volledig. Dit lijkt imho trouwens veel te veel op een post ala 'hier heb je code, port die ff voor mij'. En daar doen we niet aan mee.

https://fgheysels.github.io/


Dit topic is gesloten.