Error with Swap Image RRS feed

  • Question

  • I originally had this problem with Frontpage 2003, and went out and bought Microsoft Expression Web because I wasn't able to build my site due to this error. Now, I'm getting the same error with EW, and cannot find a fix anywhere and cannot return the product because it's opened. I feel as if I've just wasted $100 because I bought this software to fix the problem I had with FP2003, and it still is not fixed.

    This is what happens:

    I go through the normal process of image swapping. Add an image, click Behaviors > Insert > Swap Image.

    All is well until I hit the "Browse" button to pick the next image to swap to.

    I get an Internet Explorer Script Error, and cannot perform the action. This is becoming a major problem for me, and I hope someone can help.

    Please see attached screenshots


    • Edited by j7art2 Thursday, April 10, 2008 10:47 AM Direct link to screenshots, wont appear in text.
    Thursday, April 10, 2008 10:44 AM


  • Problem solved.

    For some reason I noticed in screenshot one, the photo was named untitled.jpg, despite being named home.jpg. Once I saved the entire file, including that picture,, I was able to use the feature with no problem.

    Thursday, April 10, 2008 9:00 PM

All replies

  • This is a system error, not an error in FP or EW. I'm not sure how to resolve it but two things you can try.

    In IE, go to 'Tools' - 'Internet Options' - 'Security'.

    Select 'Internet' and then 'Custom Level'. Scroll down almost to the bottom of the settings list to 'Active Scripting'. Make sure this is enabled.

    It may not work but is worth trying. Someone will be along with a solution.

    Although you've made the upgrade and may feel you've spent your $100 unneccesarily, you will find EW gives you very much better tools to work with once you're into it. It's definitely worth it.



    Ian Haynes
    Thursday, April 10, 2008 12:54 PM
  • Using Windows Explorer, browse to: C:\Program Files\Microsoft Expression\Templates\1033\Behaviors12\ACTIONS
    and rename SWAPIMG.HTM to something like XSWAPIMG.HTMX

    Then go to Control Panel > Add or Remove Programs.
    Scroll down to Microsoft Expression Web.
    Click it to select it.
    Click Change.
    Click Repair.
    When it is done check C:\Program Files\Microsoft Expression\Templates\1033\Behaviors12\ACTIONS
    to see if SWAPIMG.HTM has been recreated, and if so then try inserting the behaviors.

    FrontPage MVP
    Thursday, April 10, 2008 1:26 PM
  • I tried both of these, and unfortunately, the problem still exists. I now have Image Swap listed twice on my insert, and neither one of them work.

    Please advise.
    Thursday, April 10, 2008 8:39 PM
  • Problem solved.

    For some reason I noticed in screenshot one, the photo was named untitled.jpg, despite being named home.jpg. Once I saved the entire file, including that picture,, I was able to use the feature with no problem.

    Thursday, April 10, 2008 9:00 PM
  • Ok, in internet Explorer go to Tools > Internet Options and click the Advanced tab.
    Under Browsing, uncheck "Display a notification about every script error and then "Check"
    "Disable script debugging."

    Click Apply and then OK

    fwiw, I tried to open SWAPIMG.HTM in EW Beta 2 to see if I could find the error and it froze EW.

    So it sounds like we have a bug.

    FrontPage MVP
    Thursday, April 10, 2008 9:03 PM
  • Ok thanks for the feedback
    FrontPage MVP
    Thursday, April 10, 2008 9:14 PM
  • Hello,

    I have the same problem, I cannot use the Swap image behavior, I get a script error.  I tried to repair Expression Web, the file Swapimg.htm was not changed (in fact I found this file in C:\Program Files\Microsoft Expression\Web 2\Templates\1033\Behaviours12\Actions)

    Please help me using this function.  I also saw other sites where the image is swapping permanently as soon as the page is displayed, is this possible with Expression?

    Thank you for your help

    • Proposed as answer by les2worry Saturday, June 20, 2009 5:42 AM
    Sunday, November 2, 2008 5:52 PM
  • I haven't located the root of the problem, but I figured out a workaround. I generated a "swap image" behavior code by inserting the behavior action for an image in master page, then I copied the code into the appropriate spot in the code for the image I had a problem inserting the behavior action previously, replaced the id and url with appropriate ones respectively and it worked. The following is the code for image swapping: onmouseover="FP_swapImg(1,1,/*id*/'imagetobereplaced_id',/*url*/'imagetobeinsertedname.jpg')". Like I said I haven't zeroed in on the bug itself, but my first thought is that it might have something to do with images being embedded in divs which are inside other divs - just a wild guess.
    Saturday, June 20, 2009 5:54 AM
  • "Like I said I haven't zeroed in on the bug itself, but my first thought is that it might have something to do with images being embedded in divs which are inside other divs - just a wild guess."

    Nope, it has to do with trying to use it on a page created from a DWT, or master page, and leaving the "Preload Images" box checked.  You need a writable <body> tag for the preload, and in a page attached to a DWT the <body> tag is not editable, and in a page associated with a Master page (if you did mean *.master, not master.dwt), there is no <body> tag at all at design time.

    Uncheck the "Preload Images" box, and you can add the swap image behavior.
    • Proposed as answer by KathyW2 Saturday, June 20, 2009 7:26 PM
    Saturday, June 20, 2009 7:26 PM
  • There are solutions using jquery which don't require the use of the body onload event, such as this one http://jquery-howto.blogspot.com/2009/02/preload-images-with-jquery.html and others. Google "jquery preload" to find a number of examples. They do require a bit of familiarity with jquery/javascript, but at least they would permit preloading with a DWT...

    Saturday, June 20, 2009 9:34 PM

    I realized that i can use the swap image without any problem if I keep my website folder on the C: drive

    than I tested if I use to some other disks.

    The conclusion is this:

    You can put your website folder wherever you want it to and you can open it from Open Site on right top of button rows in EW.

    The error is only come up if you have a virtual harddrive (in my case it was my D: drive) what is actually on the same drive as te C: drive but act like a separate hard drive beacuse I partitioned that way when I was setting up XP at the first time.


    Go to Control Panel> Administrative Tools > Computer Management> Disk Management

    and see if the drive where your website folder gave you error is actually sitting on a physical harddrive virtually.

    i hope someone else will also find this solution helpful and finally get rid of the problem.


    Thursday, January 21, 2010 7:36 PM
  • ???

    That response has nothing to do with the issue of the thread, which, BTW, has already been answered and marked as such. Neither of the solutions posted had anything to do with virtual drives. The thread itself is almost two years old, and has been moribund for eight months. Please note the request in the FAQs for the forum that you not resurrect old, dead threads. Thank you.

    C'mon, folks. This isn't rocket science, nor neurosurgery. It's "Expression" (singular) "Web" (singular), in that order, followed by a version numeral if you wish to be specific. It is often abbreviated "EW." It is not "Web Expression," "Expressions Web," "Web Expressions," or plain "Expression" or "Expressions." Not using the correct name indicates either ignorance or laziness. Most folks would rather avoid the appearance of either.
    Thursday, January 21, 2010 8:19 PM
  • This solution worked for me. I had upgraded to Web 4 and the problem remained until I discovered that Web 4 uses the same templates as Web 2
    • Proposed as answer by Tom Mein Tuesday, January 25, 2011 11:08 AM
    Tuesday, January 25, 2011 11:08 AM
  • What part of "Do Not Resurrect Old Dead Threads" do you not understand? Especially for a "Me, too!" post.

    The thread has already been marked answered . The OP, who is the only one that can mark anything as answer, hasn't been seen in the forum since this one bloody post THREE YEARS AGO! And even if those things weren't true, "This solution worked for me" is indeterminate and meaningless, since several different solutions were proposed during the course of the thread.

    Read the "READ THIS ** BEFORE ** YOU POST" thread, the one you were supposed to read before you posted , and stop ignoring forum etiquette and guidelines.


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.
    Tuesday, January 25, 2011 2:10 PM
  • Here I am, TWELVE years since this chain has seen action, still an avid user of FP 2003 on WINDOWS 10!  I recently had the SWAP IMAGE and SWAP IMAGE RESTORE options disappear from the Insert Behavior menu. My first workaround was to manually insert the code which worked, but still wanted to be able to use the simpler menu options.  The above solution worked for me, but I also changed the names of the SWAPIMG.js files.  Ran repair from the ADD/REMOVE programs.  Performed the suggested reboot for changes to take effect.  Now, I have each SWAP IMAGE and SWAP IMAGE RESTORE option listed TWICE in the menu, but at least they all work.  Yes, there are websites still being built with FP 2003.  Add ".com" to my user name and see for yourself.  Thanks for the solution. --Dan
    Thursday, March 19, 2020 8:32 PM