473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to set the default home page using php code in Firefox

Anz
I used the javascript functions as shown below.
<a href="javascript:;;;"
onclick="this.style.behavior='url(#default#homepag e)';
this.setHomePage(location.href);">

But this code works for IE, not for Firefox. While running this code,
the firefox shows javascript error as

this.setHomePage is not a function

Is there any javascript function available for both the browsers?
Jun 27 '08 #1
7 2994
Anz wrote:
I used the javascript functions as shown below.
<a href="javascript:;;;"
Pure nonsense. http://jibbering.com/faq/#FAQ4_24
onclick="this.style.behavior='url(#default#homepag e)';
this.setHomePage(location.href);">

But this code works for IE, not for Firefox.
Yes, it is IE-proprietary nonsense.
While running this code, the firefox shows javascript error as

this.setHomePage is not a function

Is there any javascript function available for both the browsers?
No, and that is good so. *I* decide when and to what I set *my* browser's
start page to, not you. Stop this nonsense while you are at it, and learn
that there are more than two browsers.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
// Plone, register_function.js:16
Jun 27 '08 #2
On Mon, 12 May 2008 04:42:47 -0700, Anz wrote:
I used the javascript functions as shown below.
<a href="javascript:;;;"
onclick="this.style.behavior='url(#default#homepag e)';
this.setHomePage(location.href);">
What's that supposed to be?
It's neither valid HTML markup nor JavaScript code nor CSS.
Looks like some junkie mixed up all he got to prepare his final kick.
But this code works for IE,
You know, M$ doesn't care for standards they do not own. So whatever
might work with M$IE is _never_ an indicator for validity outside a
strictly controlled M$-laboratory.
[...]
this.setHomePage is not a function
Indeed! Setting up the browser's start page is _not_ subject to
arbitrary user code originating at whatever dubious sources.
Where did you dream up that function call?
Is there any javascript function available for both the browsers?
Sure, even M$IE couldn't fail to implement some JavaScript functions. So
even functions like "window.alert()" are "available for both the browsers".
Anything special you're looking for?
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #3
Matthias Watermann wrote:
On Mon, 12 May 2008 04:42:47 -0700, Anz wrote:
>I used the javascript functions as shown below.
<a href="javascript:;;;"
onclick="this.style.behavior='url(#default#homepa ge)';
this.setHomePage(location.href);">

What's that supposed to be?
It's neither valid HTML markup
Imagine there is an end tag. Then it *is* Valid HTML, actually.
nor JavaScript code
Yes, it is.
nor CSS.
It was not intended to be, was it?
Looks like some junkie mixed up all he got to prepare his final kick.
Most definitely :)
> Is there any javascript function available for both the browsers?

Sure, even M$IE couldn't fail to implement some JavaScript functions. So
even functions like "window.alert()" are "available for both the browsers".
But neither one is a "javascript function". Both are, if supported, methods
provided by the UA's API.
Anything special you're looking for?
There's a script-kiddie playing in the sandbox, I presume.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jun 27 '08 #4
On May 12, 12:42 pm, Anz <anzbmuham...@gmail.comwrote:
I used the javascript functions as shown below.
<a href="javascript:;;;"
onclick="this.style.behavior='url(#default#homepag e)';
this.setHomePage(location.href);">

But this code works for IE, not for Firefox. While running this code,
the firefox shows javascript error as

this.setHomePage is not a function

Is there any javascript function available for both the browsers?
Any website that tries to force me to make it my home page gets
immediately blacklisted forever. I want to see Google when I start my
browser, not your site which I can promise you will not be as useful
as Google.
Jun 27 '08 #5
On Mon, 12 May 2008 16:46:03 +0200, Thomas 'PointedEars' Lahn wrote:
Matthias Watermann wrote:
>On Mon, 12 May 2008 04:42:47 -0700, Anz wrote:
>>I used the javascript functions as shown below. <a
href="javascript:;;;"
onclick="this.style.behavior='url(#default#homep age)';
this.setHomePage(location.href);">

What's that supposed to be?
It's neither valid HTML markup

Imagine there is an end tag. Then it *is* Valid HTML, actually.
Uh? I was under the impression that a "href" attribute is supposed
to contain an URL. Where is an URI type/syntax of "javascript:;;;"
defined? (Ignoring the fact that such an abuse is very hostile to
readers.)
>nor JavaScript code

Yes, it is.
You mean the content of the "onclick" attribute, right? But that's
only a part, a fragment not the whole thing the OP posted.
>nor CSS.

It was not intended to be, was it?
Who knows? Something like "this.style. ..." looks like CSS.
>Looks like some junkie mixed up all he got to prepare his final kick.

Most definitely :)
Alas, everything seems more complicated nowadays. Some LSD in the
sixties or a joint in the seventies were not that hard to get as a
properly f**cked up web-page involving markup, scripting and styling.
You can get it by accident, sure, but to make it intentionally and
properly is not that easy as the OP now learns the hard way.
>> Is there any javascript function available for both the browsers?

Sure, even M$IE couldn't fail to implement some JavaScript functions.
So even functions like "window.alert()" are "available for both the
browsers".

But neither one is a "javascript function". Both are, if supported,
methods provided by the UA's API.
Do you think he knows the difference? Considering he tried to call
a "setHomePage() method of an anchor element?
>Anything special you're looking for?

There's a script-kiddie playing in the sandbox, I presume.
Ah, good point! I think, we should leave him alone then.
--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #6
Matthias Watermann wrote:
On Mon, 12 May 2008 16:46:03 +0200, Thomas 'PointedEars' Lahn wrote:
>Matthias Watermann wrote:
>>On Mon, 12 May 2008 04:42:47 -0700, Anz wrote:
I used the javascript functions as shown below. <a
href="javascript:;;;"
onclick="this.style.behavior='url(#default#home page)';
this.setHomePage(location.href);">
What's that supposed to be?
It's neither valid HTML markup
Imagine there is an end tag. Then it *is* Valid HTML, actually.

Uh? I was under the impression that a "href" attribute is supposed
to contain an URL. Where is an URI type/syntax of "javascript:;;;"
defined? (Ignoring the fact that such an abuse is very hostile to
readers.)
According to the relevant Specifications, the value of the `href' attribute
must be of type _URI_, i.e. a URI or URI reference as defined in RFC3986
(which obsoletes RFC2396 as referred to by the HTML 4.01 Specification). By
these criteria, `javascript:;;;' does qualify as a URI: However
proprietary, `javascript' can be produced as the scheme name, and `;;;' can
be produced by the `path-rootless' production of the RFC's grammar.

,-<http://www.rfc-editor.org/rfc/rfc3986.txt>
|
| Appendix A. Collected ABNF for URI
|
| URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
| [...]
| scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
| [...]
| hier-part = "//" authority path-abempty
| / path-absolute
| / path-rootless
| / path-empty
| [...]
| path-rootless = segment-nz *( "/" segment )
| [...]
| segment-nz = 1*pchar
| [...]
| pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
| [...]
| sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
| / "*" / "+" / "," / ";" / "="

It is notable that the `;' character actually serves as sub-delimiter in
ECMAScript implementations: it delimits adjacent Statements. In fact, we
have three adjacent EmptyStatements here. Not useful, and certainly not to
be recommended in this context, but syntactically valid nonetheless.

(You asked for it ;-))
>>nor JavaScript code
Yes, it is.

You mean the content of the "onclick" attribute, right?
And the value of the `href' attribute.
But that's only a part, a fragment not the whole thing the OP posted.
Doesn't matter. I would consider it to be wrong to say that it is not
JavaScript when a subset is written in what could be executed as JavaScript.
>>nor CSS.
It was not intended to be, was it?

Who knows? Something like "this.style. ..." looks like CSS.
You are confused. Something like this could only be CSS (i.e. be produced
by the CSS grammar) if there was an element type `this' that had a `class'
attribute with value `style'. Since we are talking HTML here, this could
never be CSS. Also, the `=' character could never be part of CSS in this
context.

It is clearly an attempt at client-side stylesheet scripting. The language
used is apparently an ECMAScript implementation here; it may be JavaScript,
or it could be considered "JavaScript" in the broadest sense. However
error-prone if used untested, the value assigned the the property here
modifies the proprietary `behavior' style property of the MSHTML DOM; in the
broadest sense, this value could be considered CSS (the CSS Specification
supports code which uses unspecified properties and values by specifying a
fallback mechanism).
>>> Is there any javascript function available for both the browsers?
Sure, even M$IE couldn't fail to implement some JavaScript functions.
So even functions like "window.alert()" are "available for both the
browsers".
But neither one is a "javascript function". Both are, if supported,
methods provided by the UA's API.

Do you think he knows the difference? Considering he tried to call
a "setHomePage() method of an anchor element?
Nope, and neither did you. Hence the clarification :)
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jun 27 '08 #7
On Mon, 12 May 2008 19:38:36 +0200, Thomas 'PointedEars' Lahn wrote:
Matthias Watermann wrote:
>On Mon, 12 May 2008 16:46:03 +0200, Thomas 'PointedEars' Lahn wrote:
>>Matthias Watermann wrote:
On Mon, 12 May 2008 04:42:47 -0700, Anz wrote:
I used the javascript functions as shown below. <a
href="javascript:;;;"
onclick="this.style.behavior='url(#default#hom epage)';
this.setHomePage(location.href);">
What's that supposed to be?
It's neither valid HTML markup
Imagine there is an end tag. Then it *is* Valid HTML, actually.

Uh? I was under the impression that a "href" attribute is supposed to
contain an URL. Where is an URI type/syntax of "javascript:;;;"
defined? (Ignoring the fact that such an abuse is very hostile to
readers.)

According to the relevant Specifications, the value of the `href'
attribute must be of type _URI_, i.e. a URI or URI reference as defined
in RFC3986 (which obsoletes RFC2396 as referred to by the HTML 4.01
Specification). By
these criteria, `javascript:;;;' does qualify as a URI: However
proprietary, `javascript' can be produced as the scheme name, and `;;;'
can be produced by the `path-rootless' production of the RFC's grammar.
Now, that's interesting! You know, I had sort of an argument the other
day with a comrade who tried to convince me that the "javascript" scheme
isn't defined anywhere in fact and that it's used only by mindless
programmers and interpreted by some tolerant browsers. And indeed, none
of the RFCs you quoted mentions "javascript" (only the usual schemes
like "ftp", "gopher", "http" etc.). So would you kindly provide a
pointer to the document(s) defining the "javascript" URI scheme? Or
does your choice of words ("proprietary") indicate that it is indeed
not official?
[...]
>>>nor JavaScript code
Yes, it is.

You mean the content of the "onclick" attribute, right?

And the value of the `href' attribute.
>But that's only a part, a fragment not the whole thing the OP posted.

Doesn't matter. I would consider it to be wrong to say that it is not
JavaScript when a subset is written in what could be executed as
JavaScript.
Well, I disagree since a "subset" is clearly not the whole. But it's
not worth arguing. So have it your way :-)
[...]
>>>nor CSS.
It was not intended to be, was it?

Who knows? Something like "this.style. ..." looks like CSS.

You are confused.
Now, that was the reason why I asked in the first place, wasn't it?
Sometimes it's hard to know what to think. Like the other day when I
took a brake from C++ programming and posting something about scope
which wasn't true for javascript at all. Fortunately there's always
someone to correct the mistakes. One of the great things about USENET.
[...]
>>>> Is there any javascript function available for both the browsers?
Sure, even M$IE couldn't fail to implement some JavaScript functions.
So even functions like "window.alert()" are "available for both the
browsers".
But neither one is a "javascript function". Both are, if supported,
methods provided by the UA's API.

Do you think he knows the difference? Considering he tried to call a
"setHomePage() method of an anchor element?

Nope, and neither did you. Hence the clarification :)
Thank you so much. I appreciate your selfless help.

--
Matthias
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST M$ ATTACHMENTS
/ \
Jun 27 '08 #8

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

Similar topics

6
by: The Bicycling Guitarist | last post by:
When I reduce the width of the window of my home page, Firefox makes the <h1> and other text and buttons go UNDERNEATH the graphic in the middle of the page. However yukky Microsoft Internet...
2
by: Goober | last post by:
I have the following default.aspx page that works properly. However, what I want to do is to link the graphics within it (that are hard coded now in the default web page) to our corporate...
8
by: Alan J. Flavell | last post by:
What I was trying to do: to offer a default stylesheet, plus another small stylesheet which can be applied additionally to the default one. Preferably, the optional stylesheet should be initially...
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
2
by: pavi | last post by:
Anyone know how to set the Default homepage using javascript without prompting a pop up. Below is the code i used to set default home page. <a href="#"...
4
by: Anz | last post by:
I used the javascript functions as shown below. <a href="javascript:;;;" onclick="this.style.behavior='url(#default#homepage)'; this.setHomePage(location.href);"> But this code works for IE,...
3
by: goldenv | last post by:
Hi all, I have worked an open source javascript + html page that has the potential to replace your existing browser home page. If you are interested in trying it out, or learning more about it, it...
3
by: Anz | last post by:
Is there any javascript function available to set the default home page which would work properly in firefox ?, I didn't find any javascript function which will work on firefox, If there any?
6
tpgames
by: tpgames | last post by:
I'm trying to get a maze to default to always giving me the image as the marker and never give me the color as the marker. The code requires you to check a box to get the image marker to be used. So,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.