2012-10-22 27 views
1

取決於我訪問的博客文章我需要一個uiwebview填充一個div的html類。它每次都是相同的div div類,名稱不會改變,只是內容。動態填充一個uiwebview與HTML的某個div類?

DIV的類名爲:

<div class="field-item even" property="content:encoded"> 

的內容是這樣的:

<div class="field-items"><div class="field-item even" property="content:encoded"><p>Data centre security is a big issue – especially for co-location centres hosting multiple racks for multiple, often competing, clients. Yet whilst security to access the data centre can often be impressive, individual rack level security is often inadequate. Given the number of in-house staff and external engineers, from cablers to storage and server providers, traipsing through a data centre on a near daily basis, poor rack level security is a potential risk.</p> 
<p>According to a recent survey conducted by Lieberman Software, 42 percent of IT staff can get unauthorised access to their organisation’s most sensitive information – including the CEO’s private documents. The failing is blamed on management’s naivety when it comes to understanding just how much privileged access their IT departments actually have.</p> 
<p>The fact that most racks are secured only with standard handles using a manual key, bears out this survey. Easily broken or bypassed, these locks provide minimal corporate protection; they offer no access control or audit trail of activity. Given the huge ongoing investment in data centres - during 2011-2012, the UK invested an estimated $3.35 billion in data centres; the second highest spending of any country, according to the Datacentre Dynamics Global Industry Census 2011 - extending standard access control techniques to the data centre racks is an important step.</p> 
<p>Companies can opt for a rack specific key, combination locks or key cards that are IP enabled to allow an organisation to impose strict control over the time/day an individual is allowed to access the rack. Using standard access control software, all activity is recorded and audited, providing the organisation with a complete list of those who have accessed the racks.</p> 
<p>For organisations, this approach adds control and addresses one important aspect of the internal threat. For co-location sites, rack level security removes the need to cage off client specific rack space areas freeing up space that can be used for more racks, delivering a return on investment, as well as improved client security.</p> 
</div> 

頁可以找到here

我需要一個方法來獲取該div中的html只是從頁面url,保持樣式,並將其放入一個字符串,然後填充uiwebview,任何人都可以幫助我嗎?

謝謝。

更好的代碼情景:

我基本上填充從博客文章的RSS提要的uitable視圖。這工作正常。點擊博客帖子會返回一個被點擊的博客帖子的網址作爲一個字符串使用。它從這裏我不知道如何加載這個字符串到一個web視圖,然後在該web視圖上使用jquery只顯示所有內容只在一個div類(這是上面提到的)。

+1

無論你想要填充哪個頁面 做一個調用prev頁面url的ajax調用,使用jquery的.children函數選擇div的內容,然後作爲響應將它帶回來,然後你可以填充你的當前div PLZ給出了特定的代碼方案,以便更好地理解 –

回答

0

你可以加載一切在頁面中進入webview,然後運行一些javascript來隱藏除div和其內容之外的所有內容。這stackoverflow question(嗯,真的,答案)看起來像它會幫助你完成。如果頁面不是很大,這可能是一條路,因爲造型會被保留爲一個很好的副作用。