string - Replace subdomain name with other subdomain Using JavaScript? -


i'm trying replace subdomain name "news.domain.com/path/.." "mobile.domain.com/path/..", using javascript

any idea how achieve this?

i'm assuming want change string in generic format xxxx.domain.com/... mobile.domain.com/.... regexp should in javascript:

var oldpath = "news.domain.com/path/"; var newpath = oldpath.replace(/^[^.]*/, 'mobile') 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -