Microsoft
Software
Hardware
Network
Question : parse url in JavaScript
I have this in my page:
pageURL = window.location + window.location.hash;
the URL ends up looking like this:
http://www.somewhere.com/4
142_234#89
773_367
how can I extract the last 4 parts of the URL, so it would be like this:
idOne='4142';
idTwo='234';
idThree='89773';
idFour='367';
we're splitting at the # and then splitting each one at the _
Answer : parse url in JavaScript
this javascript will get you all four in one array
var myArray = str.split(/#|_/g);
and this will give that last string
var str="
http://www.somewhere.
com/4142_2
34#89773_3
67
";
document.write( str.substring( str.lastIndexOf("/") + 1));
Random Solutions
iSCSI Performance Tuning
Generate wsdl stub - getting error .
Save Publishign site as template in SharePoint 2010
Sun Certified Developer for Java Web Services 5 - Study guide/suggestions
LINUX -- PHP + Sendmail Woes -- Emails not being sent.
Unable to access OWA
What's the most efficent way to move a MS 2008 file server from Virtual Iron to VMWare?
Windows 2003 DC, want to install DNS but setup fails on missing file(s). (dnsperf.h)
Imaging a RAID Setup to a Non-RAID Disk
Dell Inspiron 1012 - Multimedia Controller Driver