473,725 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What am I doing wrong here. Simple statement. Novice Question.

HI! I get an error with this code.

<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT>

Basicly I want my iframe to have a default page if the user enters in
directly. so I need a way doing this. so I check to see if the ifp value is
null and if so then assign it a value. is this correct?
Thanks in advance :)

Paul
Jul 23 '05 #1
17 2644
"Paul" <pa***********@ sympatico.ca> wrote in message
news:uL******** ***********@new s20.bellglobal. com...
HI! I get an error with this code.

<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT>

Basicly I want my iframe to have a default page if the user enters in
directly. so I need a way doing this. so I check to see if the ifp value is
null and if so then assign it a value. is this correct?
Thanks in advance :)

Paul

As you don't state the error I may wrong but if, as I expect, it is "object
expected" then it's because you have a capital "I" in "If" which should be
lowercase:

if (ifp == "")
{
ifp = "default.ht m";
}

In general all JavaScript keywords start with lowercase letters, built-in
objects such as "String" are one such exception, and usually if two or more
words are concatenated all but the first have an uppercase first letter, e.g
"toLowerCas e". An exception to this are the operators such as "typeof".
--
As a side point, although in this instance the syntax is the same, Java and
JavaScript are two different beasts and I suggest restricting your choice of
groups to the relevant ones.

Joe (MVP)

https://mvp.support.microsoft.com/pr...8-8741D22D17A5

Jul 23 '05 #2
ASM
Paul wrote:
HI! I get an error with this code.

<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT>

Basicly I want my iframe to have a default page if the user enters in
directly.
if(!(parent.fra mes['myIframe'])
self.location=" http//server.name/site.name/folder/default.html";

if main page doesn't have an iframe (or frame) nammed "myIframe"
then
load in same window the file 'default.htm'
whom path is "http//server.name/site.name/folder/"

or :
if(!(parent.fra mes['myIframe'])
top.location="h ttp//server.name/site.name/folder/default.html";

if parent page doesn't have an iframe (or frame) nammed "myIframe"
then
load in main window the file 'default.htm'
whom path is "http//server.name/site.name/folder/"
so I need a way doing this. so I check to see if the ifp value is
null and if so then assign it a value. is this correct?


from where comes ifp (how does it get ist value) ?
what do you do with this value (after correction or not) ?
--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #3
ASM
ASM wrote:

if(!(parent.fra mes['myIframe'])
if(!(parent.fra mes['myIframe']))
or :
if(!(parent.fra mes['myIframe'])


if(!(parent.fra mes['myIframe']))

--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #4
Paul wrote:
<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT> <snip> ... . so I check to see if the ifp
value is null ...

<snip>

The algorithm for the type-converting comparison operator - == - (ECMA
262 3rd edition; section 11.9.3) does not allow any string value
(including the empty string) to equal null. So whatever you are
attempting you are not seeing if ifp is null.

Richard.
Jul 23 '05 #5
Hi! and thanks for responding. basically I have a menu with sub-menu options
which are htm file to go into an iframe.
I need it to be so I can do this from any page in my site. this is why I
need a script to pass the value.

In my menu I use the following code to send the sub-menu options.

Sub-menu option 1: ( code below )
MainIframepage. asp?ifp=Templat e_Code_Files/file1_for_ifram es.htm

Sub-menu option 2: ( code below )
MainIframepage. asp?ifp=Templat e_Code_Files/file2_for_ifram e.htm

Now for the MainIframepage. asp file I created the following Iframe like
this---and it works fine.

<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 " width="750px"
height="920px" scrolling="yes" id="Iframe001"> If you are reading this then
your browser cannot view Iframe, Please upgrade you browser. </iframe>

Now the problem is for me is what happens if someone enters the page without
clicking an sub-option. ( Like for instance, coming from a bookmark OR if
the session times out.) he will get an empty Iframe.

That's what I need the default value for. :) How can I accomplish this?

Paul

"ASM" <st************ *********@wanad oo.fr.invalid> wrote in message
news:42******** **************@ news.wanadoo.fr ...
Paul wrote:
HI! I get an error with this code.

<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT>

Basicly I want my iframe to have a default page if the user enters in
directly.


if(!(parent.fra mes['myIframe'])
self.location=" http//server.name/site.name/folder/default.html";

if main page doesn't have an iframe (or frame) nammed "myIframe"
then
load in same window the file 'default.htm'
whom path is "http//server.name/site.name/folder/"

or :
if(!(parent.fra mes['myIframe'])
top.location="h ttp//server.name/site.name/folder/default.html";

if parent page doesn't have an iframe (or frame) nammed "myIframe"
then
load in main window the file 'default.htm'
whom path is "http//server.name/site.name/folder/"
so I need a way doing this. so I check to see if the ifp value is null
and if so then assign it a value. is this correct?


from where comes ifp (how does it get ist value) ?
what do you do with this value (after correction or not) ?
--
Stephane Moriaux et son [moins] vieux Mac

Jul 23 '05 #6
HI! thanks, I saw that little one after I posted it. but there is still a
problem. and the other post answered that one.

Do you know of another way to do it. ( other than converting the string and
then back again )?

Thanks in advance :)

Paul
"Joe Fawcett" <jo********@new sgroups.nospam> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
"Paul" <pa***********@ sympatico.ca> wrote in message
news:uL******** ***********@new s20.bellglobal. com...
HI! I get an error with this code.

<SCRIPT language="JavaS cript">
If (ifp==""){
ifp="default.ht m"}
//--></SCRIPT>

Basicly I want my iframe to have a default page if the user enters in
directly. so I need a way doing this. so I check to see if the ifp value
is null and if so then assign it a value. is this correct?
Thanks in advance :)

Paul

As you don't state the error I may wrong but if, as I expect, it is
"object expected" then it's because you have a capital "I" in "If" which
should be lowercase:

if (ifp == "")
{
ifp = "default.ht m";
}

In general all JavaScript keywords start with lowercase letters, built-in
objects such as "String" are one such exception, and usually if two or
more words are concatenated all but the first have an uppercase first
letter, e.g "toLowerCas e". An exception to this are the operators such as
"typeof".
--
As a side point, although in this instance the syntax is the same, Java
and JavaScript are two different beasts and I suggest restricting your
choice of groups to the relevant ones.

Joe (MVP)

https://mvp.support.microsoft.com/pr...8-8741D22D17A5

Jul 23 '05 #7
ASM
Paul wrote:
Hi! and thanks for responding. basically I have a menu with sub-menu options
which are htm file to go into an iframe.
sub-menu by options from a select ?
because if it is by JS, basicaly,
the main menu must send a page with sub-menus linked in it
I need it to be so I can do this from any page in my site. this is why I
need a script to pass the value.

In my menu I use the following code to send the sub-menu options.

Sub-menu option 1: ( code below )
MainIframepage. asp?ifp=Templat e_Code_Files/file1_for_ifram es.htm
and ? where is the problem ? it is basic html ...

<form action="MainIfr amepage.asp" target="Iframe0 01" method="get">
<select name="ifp">
<option selected="selec ted"
value="Template _Code_Files/default_menu.ht m">Main Menu</option>
<option
value="Template _Code_Files/file1_for_ifram e.htm">sub-menu 1</option>
<option
value="Template _Code_Files/file2_for_ifram e.htm">sub-menu 2</option>
</select>
<input type="submit" value="GO">
</form>
Now for the MainIframepage. asp file I created the following Iframe like
this---and it works fine.

<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 " width="750px"
height="920px" scrolling="yes" id="Iframe001"> If you are reading this then
your browser cannot view Iframe, Please upgrade you browser.
Sorry I am not to your orders !
If you want I pay a visit to your site
please give me a page I can read !
That't to say insert betwen tags of iframe a link to the plan of site
with links in basic html sending in self window.
Your way of doing is a real expression of incorrection and unpoliteness

</iframe>
Now the problem is for me is what happens if someone enters the page without
clicking an sub-option. ( Like for instance, coming from a bookmark OR if
the session times out.) he will get an empty Iframe.


Do not understand :
- the link is on the page (even in an option of select)
- the mechanism of send is in the browser
If there is a question of time spent on site it is the job of your asp :
time out or time unexisting ? hop ! go to page default
and ... I know anything about asp.

your [Request.QuerySt ring("ifp")] has to enquiry if 'ifp' exists
if not : hop -> default page
if it is : hop ! what is write in url (remenber : target="Iframe0 01")

as I know anything in asp
I would have given the default page to the src of iframe
<iframe src="default.ht m" name="Iframe001 " width="750px" blah>
Activing menu will send a page to the iframe with variable ifp to obey

The querry about ifp and its different answeres would have to be in your
"MainIframepage .asp"

Is there not a ng for asp ?

--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #8
Hi! Thanks for responding.

I wanted to use JS for ASP. I am a beginner in JS and ASP. I can here
because I needed to know JS.

I have narrowed it down bit more as I have being reading all day but I am
still of coarse shaky, so please bare with me.

Here's where I am at now. I am testing this page.. and please tell me where
I am going wrong.
If you view this page the var ifp gets written out on screen ( so its not
empty ) but it does not work in the Request.Query and I don't know why.
this is really puzzling me. I have being at this all day. I know its a
string as Its being displayed on screen. and Request.QuerySt ring works when
I pass the value from another page. why does it not accept the value that I
have declared?

<%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<head>
<title>Test Page</title>
<script language="JavaS cript">
var
ifp="http://www.webcandesig n.com/Without_fl/html/Premium_Templat es_test.asp?ifp =http://office.microsof t.com/en-us/default.aspx";
if (typeof(ifp) == "undefined" ){
document.write ("Type of x is undefined");}
else{
document.write (ifp);}
</script>
</head>
</html>
<body>
<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 "
width="750px" height="920px" scrolling="yes" id="Iframe001"> If you are
reading this then your browser cannot view Iframe, Please upgrade you
browser. </iframe>
</body>
</html>
Ps. I hope I did not come off being rude before by using Capitals letters, I
sometimes use it to point out things so that it does not get overlooked. I
will try to keep away from using that method :)

Paul

"ASM" <st************ *********@wanad oo.fr.invalid> wrote in message
news:42******** *************** @news.wanadoo.f r...
Paul wrote:
Hi! and thanks for responding. basically I have a menu with sub-menu
options which are htm file to go into an iframe.


sub-menu by options from a select ?
because if it is by JS, basicaly,
the main menu must send a page with sub-menus linked in it
I need it to be so I can do this from any page in my site. this is why I
need a script to pass the value.

In my menu I use the following code to send the sub-menu options.

Sub-menu option 1: ( code below )
MainIframepage. asp?ifp=Templat e_Code_Files/file1_for_ifram es.htm


and ? where is the problem ? it is basic html ...

<form action="MainIfr amepage.asp" target="Iframe0 01" method="get">
<select name="ifp">
<option selected="selec ted"
value="Template _Code_Files/default_menu.ht m">Main Menu</option>
<option
value="Template _Code_Files/file1_for_ifram e.htm">sub-menu 1</option>
<option
value="Template _Code_Files/file2_for_ifram e.htm">sub-menu 2</option>
</select>
<input type="submit" value="GO">
</form>
Now for the MainIframepage. asp file I created the following Iframe like
this---and it works fine.

<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 "
width="750px" height="920px" scrolling="yes" id="Iframe001"> If you are
reading this then your browser cannot view Iframe, Please upgrade you
browser.


Sorry I am not to your orders !
If you want I pay a visit to your site
please give me a page I can read !
That't to say insert betwen tags of iframe a link to the plan of site with
links in basic html sending in self window.
Your way of doing is a real expression of incorrection and unpoliteness

</iframe>

Now the problem is for me is what happens if someone enters the page
without clicking an sub-option. ( Like for instance, coming from a
bookmark OR if the session times out.) he will get an empty Iframe.


Do not understand :
- the link is on the page (even in an option of select)
- the mechanism of send is in the browser
If there is a question of time spent on site it is the job of your asp :
time out or time unexisting ? hop ! go to page default
and ... I know anything about asp.

your [Request.QuerySt ring("ifp")] has to enquiry if 'ifp' exists
if not : hop -> default page
if it is : hop ! what is write in url (remenber : target="Iframe0 01")

as I know anything in asp
I would have given the default page to the src of iframe
<iframe src="default.ht m" name="Iframe001 " width="750px" blah>
Activing menu will send a page to the iframe with variable ifp to obey

The querry about ifp and its different answeres would have to be in your
"MainIframepage .asp"

Is there not a ng for asp ?

--
Stephane Moriaux et son [moins] vieux Mac

Jul 24 '05 #9
Sorry about the above.. I made a small copy error.

<%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<head>
<title>Test Page</title>
<script language="JavaS cript">
var
ifp="http://office.microsof t.com/en-us/default.aspx";
if (typeof(ifp) == "undefined" ){
document.write ("Type of x is undefined");}
else{
document.write (ifp);}
</script>
</head>
</html>
<body>
<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 "
width="750px" height="920px" scrolling="yes" id="Iframe001"> If you are
reading this then your browser cannot view Iframe, Please upgrade you
browser. </iframe>
</body>
</html>
--
Thanks in advance :)

Paul
"Paul" <pa***********@ sympatico.ca> wrote in message
news:Ln******** ************@ne ws20.bellglobal .com...
Hi! Thanks for responding.

I wanted to use JS for ASP. I am a beginner in JS and ASP. I can here
because I needed to know JS.

I have narrowed it down bit more as I have being reading all day but I am
still of coarse shaky, so please bare with me.

Here's where I am at now. I am testing this page.. and please tell me
where I am going wrong.
If you view this page the var ifp gets written out on screen ( so its not
empty ) but it does not work in the Request.Query and I don't know why.
this is really puzzling me. I have being at this all day. I know its a
string as Its being displayed on screen. and Request.QuerySt ring works
when I pass the value from another page. why does it not accept the value
that I have declared?

<%@LANGUAGE="JA VASCRIPT" CODEPAGE="1252" %>
<html>
<head>
<title>Test Page</title>
<script language="JavaS cript">
var
ifp="http://www.webcandesig n.com/Without_fl/html/Premium_Templat es_test.asp?ifp =http://office.microsof t.com/en-us/default.aspx";
if (typeof(ifp) == "undefined" ){
document.write ("Type of x is undefined");}
else{
document.write (ifp);}
</script>
</head>
</html>
<body>
<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 "
width="750px" height="920px" scrolling="yes" id="Iframe001"> If you are
reading this then your browser cannot view Iframe, Please upgrade you
browser. </iframe>
</body>
</html>
Ps. I hope I did not come off being rude before by using Capitals letters,
I sometimes use it to point out things so that it does not get overlooked.
I will try to keep away from using that method :)

Paul

"ASM" <st************ *********@wanad oo.fr.invalid> wrote in message
news:42******** *************** @news.wanadoo.f r...
Paul wrote:
Hi! and thanks for responding. basically I have a menu with sub-menu
options which are htm file to go into an iframe.


sub-menu by options from a select ?
because if it is by JS, basicaly,
the main menu must send a page with sub-menus linked in it
I need it to be so I can do this from any page in my site. this is why I
need a script to pass the value.

In my menu I use the following code to send the sub-menu options.

Sub-menu option 1: ( code below )
MainIframepage. asp?ifp=Templat e_Code_Files/file1_for_ifram es.htm


and ? where is the problem ? it is basic html ...

<form action="MainIfr amepage.asp" target="Iframe0 01" method="get">
<select name="ifp">
<option selected="selec ted"
value="Template _Code_Files/default_menu.ht m">Main Menu</option>
<option
value="Template _Code_Files/file1_for_ifram e.htm">sub-menu 1</option>
<option
value="Template _Code_Files/file2_for_ifram e.htm">sub-menu 2</option>
</select>
<input type="submit" value="GO">
</form>
Now for the MainIframepage. asp file I created the following Iframe like
this---and it works fine.

<iframe src="<%=Request .QueryString("i fp")%>" name="Iframe001 "
width="750px" height="920px" scrolling="yes" id="Iframe001"> If you are
reading this then your browser cannot view Iframe, Please upgrade you
browser.


Sorry I am not to your orders !
If you want I pay a visit to your site
please give me a page I can read !
That't to say insert betwen tags of iframe a link to the plan of site
with links in basic html sending in self window.
Your way of doing is a real expression of incorrection and unpoliteness

</iframe>

Now the problem is for me is what happens if someone enters the page
without clicking an sub-option. ( Like for instance, coming from a
bookmark OR if the session times out.) he will get an empty Iframe.


Do not understand :
- the link is on the page (even in an option of select)
- the mechanism of send is in the browser
If there is a question of time spent on site it is the job of your asp :
time out or time unexisting ? hop ! go to page default
and ... I know anything about asp.

your [Request.QuerySt ring("ifp")] has to enquiry if 'ifp' exists
if not : hop -> default page
if it is : hop ! what is write in url (remenber : target="Iframe0 01")

as I know anything in asp
I would have given the default page to the src of iframe
<iframe src="default.ht m" name="Iframe001 " width="750px" blah>
Activing menu will send a page to the iframe with variable ifp to obey

The querry about ifp and its different answeres would have to be in your
"MainIframepage .asp"

Is there not a ng for asp ?

--
Stephane Moriaux et son [moins] vieux Mac


Jul 24 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
19093
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have any preconceived ideas about it. I have noticed, however, that every programmer I talk to who's aware of Python is also talking about Ruby. So it seems that Ruby has the potential to compete with and displace Python. I'm curious on what basis it...
5
2370
by: Marian | last post by:
Hi, I am totaly novice in .NET and I am studying a book about this. There was mentioned "assembly". I did not understand, how function does it has . I would like to know the exact run of code (intermediate language and so on). Is there any page on internet, which makes me clear? Thanx
125
14788
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
44
4252
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there must be many know the answer here. thanks
12
3301
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. Such things happen. The whole subsystem is going through radical changes. I don't really want to say what I think of the code just yet. That would influence the opinions of others, and I really want to know how other people view these things,...
6
3300
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in directly. so I need a way doing this. so I check to see if the ifp value is null and if so then assign it a value. is this correct?
121
10122
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode support IDEs are DreamWeaver 8 and Zend PHP Studio. DreamWeaver provides full support for Unicode. However, DreamWeaver is a web editor rather than a PHP IDE. It only supports basic IntelliSense (or code completion) and doesn't have anything...
669
26047
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic paper written on this subject. On the Expressive Power of Programming Languages, by Matthias Felleisen, 1990. http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
9
3191
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will load with different data (locations, departments, etc.).
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.