SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ActiveX in IE activated by alert box problem

    Upon execution of this script, IE decides to open up a "allow activex content". Is there a way to get around this or do I need to rewrite the whole script? It's for an ebay site and customers would because rather close the window than "trust" it.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <title></title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script language="Javascript" type="text/javascript">
    function getPostage() {
    var postcodes = [
    { 'min': 4000, 'max': 4416, 'text': '$124.95 and 2 days' },
    { 'min': 4418, 'max': 4419, 'text': '$124.95 and 2 days' },
    { 'min': 4421, 'max': 4427, 'text': '$124.95 and 2 days' },
    { 'min': 4500, 'max': 4575, 'text': '$124.95 and 2 days' },
    { 'min': 4600, 'max': 4676, 'text': '$124.95 and 2 days' },
    { 'min': 4680, 'max': 4680, 'text': '$124.95 and 2 days' },
    { 'min': 4700, 'max': 4701, 'text': '$124.95 and 2 days' },
    { 'min': 4740, 'max': 4740, 'text': '$124.95 and 2 days' },

    /* end of Zone 1 */

    { 'min': 4580, 'max': 4581, 'text': '$209.95 and 4 days' },
    { 'min': 4677, 'max': 4678, 'text': '$209.95 and 4 days' },
    { 'min': 4694, 'max': 4699, 'text': '$209.95 and 4 days' },
    { 'min': 4702, 'max': 4723, 'text': '$209.95 and 4 days' },
    { 'min': 4737, 'max': 4739, 'text': '$209.95 and 4 days' },
    { 'min': 4741, 'max': 4822, 'text': '$209.95 and 4 days' },
    { 'min': 4849, 'max': 4870, 'text': '$209.95 and 4 days' },
    { 'min': 4872, 'max': 4873, 'text': '$209.95 and 4 days' },
    { 'min': 4878, 'max': 4886, 'text': '$209.95 and 4 days' },

    /* end of Zone 2 */

    { 'min': 4417, 'max': 4420, 'text': '$374.95 and 5 days' },
    { 'min': 4428, 'max': 4498, 'text': '$374.95 and 5 days' },
    { 'min': 4724, 'max': 4736, 'text': '$374.95 and 5 days' },
    { 'min': 4823, 'max': 4830, 'text': '$374.95 and 5 days' },
    { 'min': 4871, 'max': 4871, 'text': '$374.95 and 5 days' },
    { 'min': 4874, 'max': 4877, 'text': '$374.95 and 5 days' },
    { 'min': 4890, 'max': 4895, 'text': '$374.95 and 5 days' },

    /* end of Zone 3 */

    { 'min': 2000, 'max': 2346, 'text': '$174.95 and 3 days' },
    { 'min': 2350, 'max': 2356, 'text': '$174.95 and 3 days' },
    { 'min': 2358, 'max': 2359, 'text': '$174.95 and 3 days' },
    { 'min': 2365, 'max': 2372, 'text': '$174.95 and 3 days' },
    { 'min': 2420, 'max': 2535, 'text': '$174.95 and 3 days' },
    { 'min': 2540, 'max': 2541, 'text': '$174.95 and 3 days' },
    { 'min': 2555, 'max': 2578, 'text': '$174.95 and 3 days' },
    { 'min': 2600, 'max': 2620, 'text': '$174.95 and 3 days' },
    { 'min': 2740, 'max': 2820, 'text': '$174.95 and 3 days' },
    { 'min': 2830, 'max': 2830, 'text': '$174.95 and 3 days' },
    { 'min': 2842, 'max': 2871, 'text': '$174.95 and 3 days' },
    { 'min': 2900, 'max': 2914, 'text': '$174.95 and 3 days' },

    /* end of Zone 4 */

    { 'min': 2347, 'max': 2357, 'text': '$249.95 and 4 days' },
    { 'min': 2360, 'max': 2361, 'text': '$249.95 and 4 days' },
    { 'min': 2379, 'max': 2415, 'text': '$249.95 and 4 days' },
    { 'min': 2536, 'max': 2539, 'text': '$249.95 and 4 days' },
    { 'min': 2545, 'max': 2551, 'text': '$249.95 and 4 days' },
    { 'min': 2579, 'max': 2594, 'text': '$249.95 and 4 days' },
    { 'min': 2621, 'max': 2739, 'text': '$249.95 and 4 days' },
    { 'min': 2821, 'max': 2829, 'text': '$249.95 and 4 days' },
    { 'min': 2831, 'max': 2834, 'text': '$249.95 and 4 days' },
    { 'min': 2873, 'max': 2877, 'text': '$249.95 and 4 days' },

    /* end of Zone 5 */

    { 'min': 2835, 'max': 2840, 'text': '$374.95 and 4 days' },
    { 'min': 2878, 'max': 2899, 'text': '$374.95 and 4 days' },

    /* end of Zone 6 */

    { 'min': 3000, 'max': 3250, 'text': '$174.95 and 3 days' },
    { 'min': 3340, 'max': 3340, 'text': '$174.95 and 3 days' },
    { 'min': 3350, 'max': 3360, 'text': '$174.95 and 3 days' },
    { 'min': 3363, 'max': 3370, 'text': '$174.95 and 3 days' },
    { 'min': 3428, 'max': 3462, 'text': '$174.95 and 3 days' },
    { 'min': 3550, 'max': 3556, 'text': '$174.95 and 3 days' },
    { 'min': 3561, 'max': 3561, 'text': '$174.95 and 3 days' },
    { 'min': 3976, 'max': 3996, 'text': '$174.95 and 3 days' },
    { 'min': 3608, 'max': 3610, 'text': '$174.95 and 3 days' },
    { 'min': 3658, 'max': 3666, 'text': '$174.95 and 3 days' },
    { 'min': 3689, 'max': 3690, 'text': '$174.95 and 3 days' },
    { 'min': 3711, 'max': 3719, 'text': '$174.95 and 3 days' },
    { 'min': 3750, 'max': 3763, 'text': '$174.95 and 3 days' },
    { 'min': 3765, 'max': 3841, 'text': '$174.95 and 3 days' },
    { 'min': 3844, 'max': 3844, 'text': '$174.95 and 3 days' },
    { 'min': 3910, 'max': 3927, 'text': '$174.95 and 3 days' },
    { 'min': 3929, 'max': 3957, 'text': '$174.95 and 3 days' },

    /* end of Zone 7 */

    { 'min': 3251, 'max': 3300, 'text': '$249.95 and 5 days' },
    { 'min': 3335, 'max': 3338, 'text': '$249.95 and 5 days' },
    { 'min': 3361, 'max': 3361, 'text': '$249.95 and 5 days' },
    { 'min': 3371, 'max': 3390, 'text': '$249.95 and 5 days' },
    { 'min': 3399, 'max': 3402, 'text': '$249.95 and 5 days' },
    { 'min': 3464, 'max': 3480, 'text': '$249.95 and 5 days' },
    { 'min': 3515, 'max': 3537, 'text': '$249.95 and 5 days' },
    { 'min': 3557, 'max': 3559, 'text': '$249.95 and 5 days' },
    { 'min': 3562, 'max': 3585, 'text': '$249.95 and 5 days' },
    { 'min': 3595, 'max': 3597, 'text': '$249.95 and 5 days' },
    { 'min': 3612, 'max': 3649, 'text': '$249.95 and 5 days' },
    { 'min': 3669, 'max': 3688, 'text': '$249.95 and 5 days' },
    { 'min': 3691, 'max': 3691, 'text': '$249.95 and 5 days' },
    { 'min': 3720, 'max': 3728, 'text': '$249.95 and 5 days' },
    { 'min': 3732, 'max': 3749, 'text': '$249.95 and 5 days' },
    { 'min': 3764, 'max': 3764, 'text': '$249.95 and 5 days' },
    { 'min': 3842, 'max': 3842, 'text': '$249.95 and 5 days' },
    { 'min': 3847, 'max': 3880, 'text': '$249.95 and 5 days' },
    { 'min': 3902, 'max': 3903, 'text': '$249.95 and 5 days' },
    { 'min': 3928, 'max': 3928, 'text': '$249.95 and 5 days' },
    { 'min': 3958, 'max': 3975, 'text': '$249.95 and 5 days' },

    /* end of Zone 8 */

    { 'min': 3301, 'max': 3334, 'text': '$374.95 and 5 days' },
    { 'min': 3341, 'max': 3345, 'text': '$374.95 and 5 days' },
    { 'min': 3391, 'max': 3396, 'text': '$374.95 and 5 days' },
    { 'min': 3407, 'max': 3427, 'text': '$374.95 and 5 days' },
    { 'min': 3463, 'max': 3463, 'text': '$374.95 and 5 days' },
    { 'min': 3482, 'max': 3512, 'text': '$374.95 and 5 days' },
    { 'min': 3539, 'max': 3549, 'text': '$374.95 and 5 days' },
    { 'min': 3586, 'max': 3594, 'text': '$374.95 and 5 days' },
    { 'min': 3599, 'max': 3607, 'text': '$374.95 and 5 days' },
    { 'min': 3693, 'max': 3709, 'text': '$374.95 and 5 days' },
    { 'min': 3730, 'max': 3730, 'text': '$374.95 and 5 days' },
    { 'min': 3882, 'max': 3900, 'text': '$374.95 and 5 days' },
    { 'min': 3904, 'max': 3909, 'text': '$374.95 and 5 days' },

    /* end of Zone 9 */

    { 'min': 5000, 'max': 5050, 'text': '$174.95 and 4 days' },
    { 'min': 5061, 'max': 5115, 'text': '$174.95 and 4 days' },
    { 'min': 5125, 'max': 5127, 'text': '$174.95 and 4 days' },
    { 'min': 5158, 'max': 5162, 'text': '$174.95 and 4 days' },
    { 'min': 5164, 'max': 5166, 'text': '$174.95 and 4 days' },
    { 'min': 5168, 'max': 5168, 'text': '$174.95 and 4 days' },
    { 'min': 5942, 'max': 5950, 'text': '$174.95 and 4 days' },

    /* end of Zone 10 */

    { 'min': 5051, 'max': 5052, 'text': '$249.95 and 5 days' },
    { 'min': 5116, 'max': 5124, 'text': '$249.95 and 5 days' },
    { 'min': 5131, 'max': 5157, 'text': '$249.95 and 5 days' },
    { 'min': 5163, 'max': 5163, 'text': '$249.95 and 5 days' },
    { 'min': 5167, 'max': 5167, 'text': '$249.95 and 5 days' },
    { 'min': 5169, 'max': 5261, 'text': '$249.95 and 5 days' },
    { 'min': 5264, 'max': 5270, 'text': '$249.95 and 5 days' },
    { 'min': 5301, 'max': 5354, 'text': '$249.95 and 5 days' },
    { 'min': 5356, 'max': 5433, 'text': '$249.95 and 5 days' },
    { 'min': 5451, 'max': 5583, 'text': '$249.95 and 5 days' },
    { 'min': 5700, 'max': 5710, 'text': '$249.95 and 5 days' },

    /* end of Zone 11 */

    { 'min': 5262, 'max': 5263, 'text': '$374.95 and 5 days' },
    { 'min': 5271, 'max': 5291, 'text': '$374.95 and 5 days' },
    { 'min': 5355, 'max': 5355, 'text': '$374.95 and 5 days' },
    { 'min': 5434, 'max': 5440, 'text': '$374.95 and 5 days' },
    { 'min': 5600, 'max': 5690, 'text': '$374.95 and 5 days' },
    { 'min': 5720, 'max': 5734, 'text': '$374.95 and 5 days' },

    /* end of Zone 12 */

    { 'min': 6000, 'max': 6213, 'text': '$324.95 and 5 days' },
    { 'min': 6215, 'max': 6232, 'text': '$324.95 and 5 days' },
    { 'min': 6280, 'max': 6380, 'text': '$324.95 and 5 days' },
    { 'min': 6390, 'max': 6390, 'text': '$324.95 and 5 days' },
    { 'min': 6401, 'max': 6405, 'text': '$324.95 and 5 days' },
    { 'min': 6427, 'max': 6427, 'text': '$324.95 and 5 days' },
    { 'min': 6460, 'max': 6460, 'text': '$324.95 and 5 days' },
    { 'min': 6501, 'max': 6510, 'text': '$324.95 and 5 days' },
    { 'min': 6556, 'max': 6569, 'text': '$324.95 and 5 days' },
    { 'min': 6832, 'max': 6997, 'text': '$324.95 and 5 days' },

    /* end of Zone 13 */

    { 'min': 6214, 'max': 6214, 'text': '$569.95 and 8 days' },
    { 'min': 6226, 'max': 6275, 'text': '$569.95 and 8 days' },
    { 'min': 6361, 'max': 6386, 'text': '$569.95 and 8 days' },
    { 'min': 6391, 'max': 6398, 'text': '$569.95 and 8 days' },
    { 'min': 6407, 'max': 6426, 'text': '$569.95 and 8 days' },
    { 'min': 6428, 'max': 6433, 'text': '$569.95 and 8 days' },
    { 'min': 6436, 'max': 6452, 'text': '$569.95 and 8 days' },
    { 'min': 6461, 'max': 6490, 'text': '$569.95 and 8 days' },
    { 'min': 6511, 'max': 6537, 'text': '$569.95 and 8 days' },
    { 'min': 6571, 'max': 6705, 'text': '$569.95 and 8 days' },

    /* end of Zone 14 */

    { 'min': 6434, 'max': 6435, 'text': '$649.95 and 8 days' },
    { 'min': 6707, 'max': 6799, 'text': '$649.95 and 8 days' },

    /* end of Zone 15 */

    { 'min': 7000, 'max': 7900, 'text': '$324.95 and 6 days' },

    /* end of Zone 16 */

    { 'min': 800, 'max': 821, 'text': '$324.95 and 5 days' },
    { 'min': 850, 'max': 853, 'text': '$324.95 and 5 days' },
    { 'min': 860, 'max': 872, 'text': '$324.95 and 5 days' },

    /* end of Zone 17 */

    { 'min': 822, 'max': 847, 'text': '$499.95 and 8 days' },
    { 'min': 880, 'max': 900, 'text': '$499.95 and 8 days' },

    /* end of Zone 18 */

    ];

    var x = prompt('Please enter your postcode:', '');
    x = parseInt(x);

    for (i in postcodes)
    {
    if ((x >= postcodes[i].min) && (x <= postcodes[i].max)) {
    document.write('Your postage cost and delivery time is ' + postcodes[i].text);
    return
    }
    }
    }
    </script>
    </head>

    <body>
    <input type="image" onClick="getPostage()" src="calculate.png" alt="Calculate Shipping and Delivery Times Here"/>
    </body>
    </html>

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,053
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)

    dialog box

    The script as posted does not involve an ActiveX control. Nor does IE6 display an "ActiveX - allow?" dialog when I try it locally. Is there something else going on somewhere else?

  3. #3
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    I think the error may just be the standard - 'Do want to allow active content to run on this page' that comes up for all local files with javascript in IE6.

  4. #4
    SitePoint Member
    Join Date
    Aug 2007
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm testing in IE7 and it happens both locally and on a server.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •