But just curious if there's a way to stop the "javascript error" from popping out in IE whenever I try to run the page locally - from a folder instead of a URL?
@starrwriterMay 09.2004 — #[i]Originally posted by lavalamp [/i]
[B]Well on a local machine it uses backslashes rather than forward slashes so this should work I [i]think[/i]:
<i> </i> if(location.pathname.indexOf("/")){
location.pathname.match(/haha/(.*)/i)[1]
} else {
location.pathname.match(/haha\(.*)/i)[1]
}
[/B][/QUOTE]
That looks close to what I have been looking for the past few weeks.
I want the insert image function to insert the relative image path (rather than the absolute path) when the user of my WYSIWYG editor browses an image from his hard drive. So that the image tag ends up: img src="photo1.jpg" instead of img src="C:/Windows/Desktop/Images/photo1.jpg"
@David_HarrisonMay 09.2004 — #How can we possibly help you if we can't see the editor? IIRC what you also keep failing to mention is that this is not a program, it's in an HTML document.
@David_HarrisonMay 11.2004 — #It sounds like all that needs to be done is a bit of code needs deleting (the bit that puts in the whole path for the image), upload it or give a link to it in a new thread and I'll see what I can do. Send me a PM in case I don't see it in the forums.
@starrwriterMay 12.2004 — #[i]Originally posted by lavalamp [/i]
[B]It sounds like all that needs to be done is a bit of code needs deleting (the bit that puts in the whole path for the image[/B][/QUOTE]
There is no code to delete. execCommand(insertimage, true) automatically opens the IE modal dialog. That is not part of my code and I can't access it to change it. It's a proprietary feature of Microsoft's edit function.
While the editor is being used, the image path must be absolute so the image is displayed in the editing window when the user inserts it. I need to ADD code to change the image path from absolute to relative when the web page under construction is saved. The solution is a few lines of script in the save function, but no one seems to have a clue.
This is the save function:
function saveFrame() {
var html = iView.document.documentElement.outerHTML;