Jump to content

[SOLVED] how to save


optikalefx

Recommended Posts

so i found this site

http://www.walterzorn.com/dragdrop/dragdrop_e.htm#flexlyr

 

and i wanted to see if theres a way to make it so i can save the source of the page and keep the placement of the pictures.

I know i have to edit the code, and ive been studying it for a while, i really want to be able to save it.  I think i have to define the position of each image, and then once you lift up from a drag, detect the change, and add that many pixels to the original position? i think..

Link to comment
Share on other sites

not quite.

 

See on that page how you can freely drag pictures around?  And if you hold shift and drag the image resizes.

I want that, but i want the changes you make to the picture to be seen in the HTML document, so that i can save the webpage as and see the changes.

 

Basically the question is how do i change the HTML to reflect the changes made to these pictures.

Link to comment
Share on other sites

ok so i did some research.

and i downloaded a firefox extension, that can edit the text on screen.  Temporarily of course.  But at that point, you can save the source and the code is actually changed to what you typed.

 

and ff extensions are only javascript and xul.  so... now what lol.

 

it actually changes the code as you type using this function.

function modifyEdit() {

    theHtml = document.getElementById("theHtml");

    theElement.innerHTML = theHtml.value;

}

 

Link to comment
Share on other sites

and ff extensions are only javascript and xul.  so... now what lol.

 

guy - you could of done that by manually editing your source code.

 

javascript cant modify html?

 

even temporarily?

 

but you cannot edit your source code with javascript - innerHTML does not physically change your source code.

 

now what guy? >:(

Link to comment
Share on other sites

i did some more research, and it seems your right that it doesnt "edit" the innerHTML but it does add new text to the source.

it ads a new div at the bottom of the page with new values, so when the page is run, those value are taken into account.  So it does work. without a server side language.

Link to comment
Share on other sites

if i use javascript to change the html or innerHtml. and then i save the page.  I can open it up later and the source is changed to the new changes that javascript made.  The use of this, is that i can make some sort of interface thing with javascirpt to edit things on the page, and save it. and then i can upload it to the web and see all those changes, not to mention the source code is the changed source, i just tested it, it works.  when you make the changes and then right click and go view source, of course the changes wont be there, but if you "reload" the page with the changes then you would see the changes.  by "reloading" we are saving and reopening.  I dont mean to sound bitchy or anything im just in discovery mode.  we can mark this as solved.

Link to comment
Share on other sites

I guess you are right; I guess it does - but this will not work if the web page is on a server. I have never really tried the save the content of a page I changed the innerHTML on; I have all of my web pages on a server and you cannot modify the source code of a web page on a server without server side language or unless you hard code the source code.

 

Update: It will work in FF, but not IE - so your resolution is not cross browser compatible.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.