Jump to content

[SOLVED] Confusing split() problem


doa24uk

Recommended Posts

Hi guys,

 

This works perfectly ....

 

var mySplit = "123456789";
var mySplitResult = url.split("5");

window.open('http://none.com/mypage.php?id=' + mySplitResult[0], 'window name')

 

So why doesn't this ?? (presume the selected text is "123456789" - same as the above example) -->

 

var focusedWindow = document.commandDispatcher.focusedWindow;
      if (focusedWindow == window) focusedWindow = getBrowser().contentWindow;

var url = focusedWindow.getSelection();

var mySplitResult = url.split("5");

window.open('http://mirrorchecker.com/linkchecker2.php?url=' + mySplitResult[0], 'window name')

Link to comment
https://forums.phpfreaks.com/topic/177129-solved-confusing-split-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.