473,384 Members | 1,854 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,384 software developers and data experts.

Two questions...

1/. Can anyone tell me why renaming a function from 'update()' to
'form_update()' makes Safari work when it didn't before?
2/. I would LIKE if possible, to do the following.

User is filling in a BIG form. MYSQL/PHP generated. he finds that the
option he needs in a select statement isn't there, and needs to be added
via a different form.

I can easily spawn a new window to do this, but what I need to happen is

- new window opens in NEW WINDOW - not new tab..even if that's how the
browser is configured.

- on shutting down new window..yea even unto clicking on it's corner and
saying 'close' , the main program window can be forced to reload its
data, to pick up the changes.

I am very unsure of inter-window communications, and could use any
pointers...
Sep 12 '07 #1
11 1256
The Natural Philosopher wrote:
1/. Can anyone tell me why renaming a function from 'update()' to
'form_update()' makes Safari work when it didn't before?
Hi,

First question: I have no clue.
Safari? I gave up on Safari and JavaScript a long time ago.
Maybe Apple upgraded it to a better browser lately?

>

2/. I would LIKE if possible, to do the following.

User is filling in a BIG form. MYSQL/PHP generated. he finds that the
option he needs in a select statement isn't there, and needs to be added
via a different form.
OK.
>
I can easily spawn a new window to do this, but what I need to happen is

- new window opens in NEW WINDOW - not new tab..even if that's how the
browser is configured.
As far as I know, the tabbed opening of a new window only happens when
you do not give dimensions.
If you do, it opens a real new window (not tabbed).

Could open in tab:
window.open("index.php","testing");

Will NOT open in tab:
window.open("index.php","testing","width=300,heigh t=300");

>
- on shutting down new window..yea even unto clicking on it's corner and
saying 'close' , the main program window can be forced to reload its
data, to pick up the changes.
Have a look at the unOnload event handler.
You can write something like this:

in popup window:
<body onUnload="refreshDaddyPlease();">

<script type="text/javascript">
function refreshDaddyPlease(){
opener.location.reload(true);
}
</script>

The true in reload(true) means force reloads, even if the http-header
If-Modified_since says otherwise.

>
I am very unsure of inter-window communications, and could use any
pointers...
Well, basic inter-window communication is simple.
eg:
[from openerpage]
var myRefToNewWindow = window.open("index.php","testing");

Now you can use myRefToNewWindow whenever you want to address the new
window. You can also call its javascript functions, eg:
myRefToNewWindow.someFunction("testing");

From the popup window, simply use the keyword 'opener' to find the
window that did it.

Good luck!

Regards,
Erwin Moller
Sep 12 '07 #2
Erwin Moller wrote:
<snip>
Have a look at the unOnload event handler.
You can write something like this:
Correction: The event handler is NOT called unOnload, but onUnload.
But you figured that yourself already probably.
;-)

Regards,
Erwin Moller
Sep 12 '07 #3
On Sep 12, 10:43 am, The Natural Philosopher <a...@b.cwrote:
1/. Can anyone tell me why renaming a function from 'update()' to
'form_update()' makes Safari work when it didn't before?
Not without the context. The balance of probability is that you were
referring to the function from an event handler generated from an
intrinsic event attributer and the scope chain that the browser
generated for the event handling function it built from the attribute
value included an object with an - update - property above the global
object.
2/. I would LIKE if possible, to do the following.

User is filling in a BIG form. MYSQL/PHP generated. he finds that the
option he needs in a select statement isn't there, and needs to be added
via a different form.

I can easily spawn a new window to do this,
Not in the sense of expecting an attempt to open a new window to be
successful.
but what I need to happen is

- new window opens in NEW WINDOW - not new tab..
Too late. The new window/tab distinction is (where available)
exclusively under user control.
even if that's how the
browser is configured.
Hard luck.
- on shutting down new window..yea even unto clicking on it's
corner and saying 'close' , the main program window can be
forced to reload its data, to pick up the changes.
So that is two inevitable HTTP request/response pairs and two sets of
processing HTML into displayed forms. In which case why not have the
existing window show the new form and then return to the old form when
it is submitted (with the data from the old form stored in the user's
session on the server in the interim)?
I am very unsure of inter-window communications, and could use any
pointers...
Avoid it like the plague.

Sep 12 '07 #4
Erwin Moller wrote:
Thomas 'PointedEars' Lahn wrote:
>Erwin Moller wrote:
>>Will NOT open in tab:
window.open("index.php","testing","width=300,hei ght=300");
Wrong.

[...]
Wrong?
Yes.
Care to explain that a little more?
It is wrong that the above call will necessarily not open a new tab.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 12 '07 #5
Thomas 'PointedEars' Lahn wrote:
Erwin Moller wrote:
>Thomas 'PointedEars' Lahn wrote:
>>Erwin Moller wrote:
Will NOT open in tab:
window.open("index.php","testing","width=300,he ight=300");
Wrong.
[...]
Wrong?

Yes.
>Care to explain that a little more?

It is wrong that the above call will necessarily not open a new tab.
Well, that clears it all up then.... NOT.
Did you care to test the samplescript?
Why don't you explain why you think it is wrong?
I did those tests on ff2 and ie7, you know, and I saw the results.

Don't get me wrong, I don't question your experience with javascript.
I know you know a lot, but your educational abilities leave somewhat to
be desired.
You might throw in a little more, like: "but it is not RFC xxy" or
"doesn't work like that in Safari/opera/Lynx".

Regards,
Erwin Moller
>

PointedEars
Sep 12 '07 #6
Erwin Moller wrote:
Thomas 'PointedEars' Lahn wrote:
>Erwin Moller wrote:
>>Thomas 'PointedEars' Lahn wrote:
Erwin Moller wrote:
Will NOT open in tab:
window.open("index.php","testing","width=300,h eight=300");
Wrong.
[...]
Wrong?
Yes.
>>Care to explain that a little more?
It is wrong that the above call will necessarily not open a new tab.

Well, that clears it all up then.... NOT.
Did you care to test the samplescript?
No, I did not need to. I used very similar code more often than you can
imagine.
Why don't you explain why you think it is wrong?
Because the correct explanation was already given by another person in this
thread.
I did those tests on ff2 and ie7, you know, and I saw the results.
So? You have tested with a very small subset of Web browsers (you did not
even include a non-browser UA), and saw your assumption confirmed. Why
would that be confirming your assumption for the general case? Don't answer
-- it does not.
Don't get me wrong, I don't question your experience with javascript.
I know you know a lot, but your educational abilities leave somewhat to
be desired.
Since when is this a J(ava)Script school? Am I being paid to sacrifice
free/business time to teach someone?
You might throw in a little more, like: "but it is not RFC xxy" or
"doesn't work like that in Safari/opera/Lynx".
For example, it does not work with Firefox 2.0.0.6 when the Tab Mix Plus
extension is installed and appropriately configured.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Sep 12 '07 #7
Erwin Moller wrote:
The Natural Philosopher wrote:
>1/. Can anyone tell me why renaming a function from 'update()' to
'form_update()' makes Safari work when it didn't before?

Hi,

First question: I have no clue.
Safari? I gave up on Safari and JavaScript a long time ago.
Maybe Apple upgraded it to a better browser lately?

>>

2/. I would LIKE if possible, to do the following.

User is filling in a BIG form. MYSQL/PHP generated. he finds that the
option he needs in a select statement isn't there, and needs to be
added via a different form.

OK.
>>
I can easily spawn a new window to do this, but what I need to happen is

- new window opens in NEW WINDOW - not new tab..even if that's how the
browser is configured.

As far as I know, the tabbed opening of a new window only happens when
you do not give dimensions.
If you do, it opens a real new window (not tabbed).

Could open in tab:
window.open("index.php","testing");

Will NOT open in tab:
window.open("index.php","testing","width=300,heigh t=300");

>>
- on shutting down new window..yea even unto clicking on it's corner
and saying 'close' , the main program window can be forced to reload
its data, to pick up the changes.

Have a look at the unOnload event handler.
You can write something like this:

in popup window:
<body onUnload="refreshDaddyPlease();">

<script type="text/javascript">
function refreshDaddyPlease(){
opener.location.reload(true);
}
</script>

The true in reload(true) means force reloads, even if the http-header
If-Modified_since says otherwise.

>>
I am very unsure of inter-window communications, and could use any
pointers...

Well, basic inter-window communication is simple.
eg:
[from openerpage]
var myRefToNewWindow = window.open("index.php","testing");

Now you can use myRefToNewWindow whenever you want to address the new
window. You can also call its javascript functions, eg:
myRefToNewWindow.someFunction("testing");

From the popup window, simply use the keyword 'opener' to find the
window that did it.

Good luck!

Regards,
Erwin Moller
Thanks Erwin.
That's the key phrases I needed.. I can 'keeep buggering on' and make
that lot work fine.
Sep 12 '07 #8
Bart Van der Donck said the following on 9/12/2007 1:26 PM:
Thomas 'PointedEars' Lahn wrote:
>Erwin Moller wrote:
>>Philosopher needed a popup to add some stuff to a big form.
What makes you think he wants a popup window for a non-browser
agent? I think that is a farfetched remote possibility,
and the OP would have stated it if that was the case.
Non sequitur.

Some common sense would suit you.
Don't get your hopes up, he has been told that for about 3-4 years now.
>>And IE & FF are a small subset of webbrowsers?
Yes, they are. Two out of a dozen, at the minimum.

No, they are not. MSIE/FF are the De Facto browsers.

MSIE & FF are a subset = right.
MSIE & FF are a small subset = wrong.
He is going to reply back with a pedant about other OS'es and that 2 is
a small subset of 12.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 12 '07 #9
The Natural Philosopher wrote:
<snip>
Indeed. It isn't even for public consumption really.
Its for an internal database.
If you are going to ask people for advice on a subject where design and
implementation decisions should be largely context driven it would be a
very good idea if you stated the real context along with the questions.
Otherwise you are just wasting people's time. It is the case that this
group's FAQ sates that the default assumption about the context will be
that questions asked relate to public web use if not stated otherwise.

<snip>
I was looking for practical solutions, and Erwins
response is practical.
<snip>

You state that you did not want the 'new window' opening in a new tab.
You can take no action that will prevent that (even on the small sub-set
of browsers that interest you) as the users of some of those browsers
have an absolute veto on the outcome of window opening attempts. The
practical advice is to design a system that does not need to be opening
new windows, and in a controlled intranet context there are at least a
couple of ways of achieving that.

Richard.

Sep 12 '07 #10
Richard Cornford wrote:
The Natural Philosopher wrote:
<snip>
>Indeed. It isn't even for public consumption really.
Its for an internal database.

If you are going to ask people for advice on a subject where design and
implementation decisions should be largely context driven it would be a
very good idea if you stated the real context along with the questions.
Otherwise you are just wasting people's time. It is the case that this
group's FAQ sates that the default assumption about the context will be
that questions asked relate to public web use if not stated otherwise.
Actually, I thought I had.
<snip>
>I was looking for practical solutions, and Erwins
response is practical.
<snip>

You state that you did not want the 'new window' opening in a new tab.
You can take no action that will prevent that (even on the small sub-set
of browsers that interest you) as the users of some of those browsers
have an absolute veto on the outcome of window opening attempts. The
practical advice is to design a system that does not need to be opening
new windows, and in a controlled intranet context there are at least a
couple of ways of achieving that.
I would PREFER not to,
However you have to again realize the context: This is a company
application. If people want to screw their browsers around to not work
in the way intended, then they shouldn't complain.

Its possible to switch the PC off altogether, but that won't help them
get the job done..

In this context this is not an application intended for world
visibility. It is designed to USE a pretty small subset of browsers -
essentially FF2 and IE7, and maybe 6, as 'smart terminals' onto a
database application. They will NOT be routinely surfing the net from
these machines: They will be set up to talk to this application only,
and depending on the location, run a couple of laser cutters, some CAD
programs and financial packages.

All I want is a way to make it unlikley that FF2 or IE6,when set to
'open new window in new tab' will do that rather than pop up an overlay.
Richard.
Sep 12 '07 #11
The Natural Philosopher wrote:
Richard Cornford wrote:
>The Natural Philosopher wrote:
<snip>
>>Indeed. It isn't even for public consumption really.
Its for an internal database.

If you are going to ask people for advice on a subject where
design and implementation decisions should be largely context
driven it would be a very good idea if you stated the real
context along with the questions. Otherwise you are just
wasting people's time. It is the case that this group's FAQ
sates that the default assumption about the context will be that
questions asked relate to public web use if not stated
otherwise.

Actually, I thought I had.
Specifically, which of the statements in the question you asked do you
perceive as providing context information?
><snip>
>>I was looking for practical solutions, and Erwins
response is practical.
<snip>

You state that you did not want the 'new window' opening
in a new tab.
<snip>
However you have to again realize the context: This is a company
application. If people want to screw their browsers around to not
work in the way intended, then they shouldn't complain.
They probably won't complain, nothing will stop working if any new
windows you attempt to open end up in a new tab. That was your
requirement not theirs. Your requirement cannot be achieved.

<snip>
All I want is a way to make it unlikley that FF2 or IE6,when set
to 'open new window in new tab' will do that rather than pop up
an overlay.
There would be no point in making a browser configurable if it then did
not behave as configured.

Richard.

Sep 12 '07 #12

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

Similar topics

0
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for...
0
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
4
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
8
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
1
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.