jquery - How Do I Turn HTML Text into a Javascript Variable While Removing Line Breaks? -


i have raw feed of text within body tag of html page. need run function on turn javascript string variable. however, there literal line breaks in html page (which not permissible in js strings).

here's example of source of page i'm working with:

<html> <head></head> <body> bldg||0|eor|  plnc||0|eor|  subd|pine manor|1|eor|  city|fort myers|1|eor|  </body> 

jquery permissible. how turn javascript variable while removing literal line breaks variables work?

var str = document.body.innerhtml.replace(/(\r\n|\n|\r)/gm,""); 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -