473,472 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

REPOST: Macormedia Javascript function in PocketIE

Reposted due to no response.

Hi guys

I am using Dreamweaver to create an intranet site that is to be accessed by
a PDA, but I have hit a problem with JavaScript under Pocket Internet
Explorer. I have added a standard DW behaviour (function to non-DW peeps)
that simply redirects the user to another page and is fired when a user hits
a button, but PocketIE seems to do nothing with it. I don't receive an error
message, line number or anything! Any help on finding / fixing the problem
would be gratefully appreciated - not being a JavaScript(let alone js on a
pda) person, I don't.know where to start.

Here's the code:

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2)
eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>

Regards
James
tgl

Jul 23 '05 #1
2 1233
James Leech wrote:
Reposted due to no response.

Hi guys

I am using Dreamweaver to create an intranet site that is to be accessed by a PDA, but I have hit a problem with JavaScript under Pocket Internet
Explorer. I have added a standard DW behaviour (function to non-DW peeps) that simply redirects the user to another page and is fired when a user hits a button, but PocketIE seems to do nothing with it. I don't receive an error message, line number or anything! Any help on finding / fixing the problem would be gratefully appreciated - not being a JavaScript(let alone js on a pda) person, I don't.know where to start.

Here's the code:

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2)
eval(args[i]+".location='"+args[i+1]+"'");

Does this code work in *any* browser? It appears to be something of
an
abomination! Maybe it makes more sense if you'd posted whatever the
arguments are.

If all you want to do is click on a button and go somewhere, and you
apparently don't want to use a normal <a href="">, why not:

<form action="">
<button onclick="
document.location='http://www.news.com'
">Go to news.com</button>
</form>

Or is simplicity dead?

--
Rob

Jul 23 '05 #2
On Wed, 22 Dec 2004 11:59:06 -0000, James Leech
<ja***@graphics-line.co.uk> wrote:

[snip]
I have added a standard DW behaviour (function to non-DW peeps)
All the code I've seen generated by DW is, quite frankly, crap. The code
you've posted is no exception.
that simply redirects the user to another page
Javascript should never be used for navigation, but as you're authoring
for an intranet, you can probably get away with it.
and is fired when a user hits a button,
Any reason why you can't just use a link? You're obviously going to have
much better luck using standard functionality.

[snip]
<script language="JavaScript" type="text/JavaScript">
[Unrelated] The language attribute is deprecated (has been for over six
years) and redundant when the (required) type attribute is present.
<!--
[Unrelated] Hiding scripts is also an out-dated practice.
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments;
document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2)
eval(args[i]+".location='"+args[i+1]+"'");


It's possible that the eval function is unimplemented. ECMA-327, which
defines a subset of ECMAScript, allows implementations to omit a few
features to reduce load on the environment. However, as I don't have
access to PocketIE I couldn't say for certain.

If you're just altering the URL for the current document, you could
simplify the function to

function goToURL(url) {location.href = url;}

If you're using frames (and you generally shouldn't):

function goToURL(url, frame) {
(frame || window).location.href = url;
}

If the frame argument is omitted, the current document will be altered.

If you really need the functionality provided by DW's original function:

function goToURL() {
for(var i = 0, n = arguments.length; i < n; i += 2) {
arguments[i].location.href = arguments[i + 1];
}
}

As you can see, eval is entirely unnecessary. The author's just clueless.

Hope that helps,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3

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

Similar topics

3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
3
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a...
4
by: Adam Knight | last post by:
Hi all, I have a page containing a aspx calendar. This page appears in a pop up window via a javascript open window command. What i need to acheive is, once a user has selected a date. This...
4
by: pdc | last post by:
have two web servers that I use, one is the primary and the other is a backup for when the server is down. I use a third, central server which redirects a browser's initial link to one of my web...
12
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in...
1
by: Jeffrey Frabutt | last post by:
Sorry about the repost... but my original post had funky characters that was causing it to get truncated. I've got a rather simple custom web control that has an object delcared as...
0
by: Mustafa Rabie | last post by:
Hi All, I am writing an ASP.NET 2.0 Web Application that users can buy and download pictures, songs, etc. I have a page that servers as the download page that fetches the file to be downloaded...
1
by: Hitchkas | last post by:
I posted this in PocketPC newsgroup with no response yet, hopefully somebody here has an answer. I have an application that runs locally on PocketPC. The user interface for this application...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.