Trang web này sẽ có chức năng hạn chế trong khi chúng tôi trải qua bảo trì để cải thiện trải nghiệm của bạn. Nếu một bài viết không giải quyết được vấn đề của bạn và bạn muốn đặt câu hỏi, chúng tôi có cộng đồng hỗ trợ của chúng tôi đang chờ để giúp bạn tại @FirefoxSupport trên Twitter và /r/firefox trên Reddit.

Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

save HTML only looses changes

  • 2 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

I create HTML files containing many photos each. Then in Firefox I Select/change div class of certain photos with

<script> function classToggle(el) { el.classList.toggle("keep"); } </script>

The intention then is to save and parse the edited HTML to identify the 'keep" photos.

If I Save File As 'HTML complete' then file is saved WITH the class changes made by <script> and the photos are copied to sub folder. The img src is changed accordingly. This is what one would expect and hope for, but not what I am aiming for.

I want to preserve the HTML changes made by <script> and leave everything else untouched. ie, don't muck with the photos. So I Save File As 'HTML only'. But the file that I get back seems to be original with the original HTML (even if I change the file name), class settings and all, not the edited version.

Google Chrome seems to do the same thing.

As a work around I could create the source HTML with comments of photo path/names then 'Save HTML complete', But the photos would still get copied to a sub folder which is a waste of time and possibly stessing my SSD.

Not too complex solutions would be appreciated - I am not an expert.

Thanks in advance.

I create HTML files containing many photos each. Then in Firefox I Select/change div class of certain photos with <script> function classToggle(el) { el.classList.toggle("keep"); } </script> The intention then is to save and parse the edited HTML to identify the 'keep" photos. If I Save File As 'HTML complete' then file is saved WITH the class changes made by <script> and the photos are copied to sub folder. The img src is changed accordingly. This is what one would expect and hope for, but not what I am aiming for. I want to preserve the HTML changes made by <script> and leave everything else untouched. ie, don't muck with the photos. So I Save File As 'HTML only'. But the file that I get back seems to be original with the original HTML (even if I change the file name), class settings and all, not the edited version. Google Chrome seems to do the same thing. As a work around I could create the source HTML with comments of photo path/names then 'Save HTML complete', But the photos would still get copied to a sub folder which is a waste of time and possibly stessing my SSD. Not too complex solutions would be appreciated - I am not an expert. Thanks in advance.

Giải pháp được chọn

^: Note that the intention is not saving the full page (HTML and other content) in one file, but is to save only the modified HTML code to save space.

You can possibly only save the HTML code of the BODY tag in the left panel in the Inspector (Copy -> Copy Outer HTML) and if necessary also do this for the HEAD tag. An alternative could be saving the generated DOM source (Select All and View Selection Source). Note that you can only save inline CSS style rules this way and not modified CSS files.

Đọc câu trả lời này trong ngữ cảnh 👍 1

Tất cả các câu trả lời (2)

more options

To save "HTML complete" in one file, try using one of these Add-ons: https://addons.mozilla.org/en-US/firefox/addon/save-page-we/ OR https://addons.mozilla.org/en-US/firefox/addon/single-file/

I use the first one.

more options

Giải pháp được chọn

^: Note that the intention is not saving the full page (HTML and other content) in one file, but is to save only the modified HTML code to save space.

You can possibly only save the HTML code of the BODY tag in the left panel in the Inspector (Copy -> Copy Outer HTML) and if necessary also do this for the HEAD tag. An alternative could be saving the generated DOM source (Select All and View Selection Source). Note that you can only save inline CSS style rules this way and not modified CSS files.