我想創建一個JavaScript書籤,它將任何網站上的所有文本(或大多數網站上的大多數文本)交換到具有相似長度的不同字符串,同時保持網站的格式。如何創建小書籤將網站上的所有文本更改爲其他類似長度的文本?
想替換爲「Lorem存有」填料的文本上nytimes.com所有文本,而不significally改變所述文本的長度。
該代碼應該能夠作爲一個書籤工作,但也可以作爲一個可嵌入的按鈕。
內容是這樣的:
<h2>Police Are Using Phone Tracking as a Routine Tool</h2>
<p class="author">By <span class="name">Eric Lichtblau</span></p>
<p>Law enforcement tracking of cellphones is a convenient surveillance tool in many situations, but it is unclear if using such technology without a warrant violates the Constitution.</p>
會變成這樣:
<h2>Lorem ipsum dolor sit amet, consectetur adipisicing</h2>
<p class="author">Sed <span class="name">Consectetur Adipisicing</span></p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat. Duis aute irure dolor in reprehenderit in voluptate velit.</p>
用來代替原來的內容文本將被預定義。
我是一個Javascript新手,我希望能夠幫助我實現這一點的技術的一些指針。也許有現有的解決方案,我還沒有找到,因爲我沒有正確的搜索術語。
我很感謝任何指針,並樂意爲自己弄點東西。
你的問題是什麼? – Zirak 2012-04-01 18:20:12
我編輯了標題以包含實際問題。 – Florian 2012-04-02 09:26:26
你是什麼意思*如何*?我們不會爲你寫信。你面臨什麼困難? [你有什麼嘗試?](http://mattgemmell.com/2008/12/08/what-have-you-tried/)這不是一個驅動代碼工廠。 – Zirak 2012-04-02 12:29:55