B
Brie_Manakul
Is there a way in javascript to do an if else that shows a script in an
iframe? Let me know if that doesn't make sense. We have a portal and
in a portlet I need to grab these javascript links to display in the
portlet if a user selects a certain city. Let me know if this can be
done. Below is my code. Any help would be greatly appreaciated.
Thanks!
<%@ page language="java" import="java.util.*, java.text.* " %>
<%@ page import="com.plumtree.remote.portlet.*" %>
<%@ page import="com.plumtree.remote.prc.*" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<% response.setHeader("Cache-Control", "max-age=3400"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Weather</title>
<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel='stylesheet'
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr></td>
<script>
if (city="albany")
{
open("http://voap.weather.com/weather/oap...l&unit=0&key=ba8a960da18891295bbc4cfea6a0dbe2");
}
else if(city="amsterdam")
{
window.open("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if(city="atlanta")
{
window.open("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='austin')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='beijing')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='berlin')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='boston')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='brussels')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='buffalo')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='calgary')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='charlotte')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='chicago')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='cleveland')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='dallas')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='detroit')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='dublin')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='edinburgh')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='edmonton')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='frankfurt')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='hongkong')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='houston')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='johannesburg')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='kansascity')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='kualalumpur')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='london')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='losangeles')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='madrid')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='manila')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='melbourne')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='mexico')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='miami')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='milan')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='minneapolis')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='montreal')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=91722c3a3c6b8b302602ce2bf13950ae")
}
else if (city='munich')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='neworleans')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='newyork')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='ottawa')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='paris')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='portland')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='prague')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='quebec')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='raleighdurham')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sacramento')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanantonio')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sandiego')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanfrancisco')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanjuan')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='seattle')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='seoul')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='shanghai')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='singapore')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='StLouis')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sydney')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='tokyo')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='toronto')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='vancouver')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if(city='warsaw')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
</script>
</td></tr></table>
</body>
iframe? Let me know if that doesn't make sense. We have a portal and
in a portlet I need to grab these javascript links to display in the
portlet if a user selects a certain city. Let me know if this can be
done. Below is my code. Any help would be greatly appreaciated.
Thanks!
<%@ page language="java" import="java.util.*, java.text.* " %>
<%@ page import="com.plumtree.remote.portlet.*" %>
<%@ page import="com.plumtree.remote.prc.*" %>
<%
String path = request.getContextPath();
String basePath =
request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<% response.setHeader("Cache-Control", "max-age=3400"); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Weather</title>
<!-- <meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0"> -->
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel='stylesheet'
href='pt://images/plumtree/portal/custom/fh_styles/style.css'>
-->
<body>
<table>
<tr></td>
<script>
if (city="albany")
{
open("http://voap.weather.com/weather/oap...l&unit=0&key=ba8a960da18891295bbc4cfea6a0dbe2");
}
else if(city="amsterdam")
{
window.open("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if(city="atlanta")
{
window.open("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='austin')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='beijing')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='berlin')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='boston')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='brussels')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='buffalo')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='calgary')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='charlotte')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='chicago')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='cleveland')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='dallas')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='detroit')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='dublin')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='edinburgh')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e'")
}
else if (city='edmonton')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='frankfurt')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='hongkong')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='houston')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='johannesburg')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='kansascity')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='kualalumpur')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='london')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='losangeles')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='madrid')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='manila')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='melbourne')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='mexico')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='miami')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='milan')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='minneapolis')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='montreal')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=91722c3a3c6b8b302602ce2bf13950ae")
}
else if (city='munich')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='neworleans')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='newyork')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='ottawa')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='paris')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='portland')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='prague')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='quebec')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='raleighdurham')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sacramento')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanantonio')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sandiego')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanfrancisco')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sanjuan')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='seattle')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='seoul')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='shanghai')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='singapore')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='StLouis')
{
String("http://voap.weather.com/weather/oap...l&unit=0&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='sydney')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='tokyo')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='toronto')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if (city='vancouver')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
else if(city='warsaw')
{
String("http://voap.weather.com/weather/oap...l&unit=1&key=67d2b0264796112ce6d75944acad734e")
}
</script>
</td></tr></table>
</body>