Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Open a webpage from an XML array

Hi, folks. first time poster, sorry if I screw up the layout.
I have a WordPress site which began as HTML/CSS. www.davidkempton.com, formerly www.thesoundsmith.com since 1998
I have not done any significant work on the site since 2010, so I have forgotten javascript and a lot of html.

The site has a couple hundred audio files connected to 20 separate pages .
I use "jwplayer" on a page from the original HTML site, here's their reference link Playlist
I could NOT get the GUI to translate to WordPress, so it is not in their list of pages or posts. When you click the link on the menu bar, it opens as a separate window.

Everything works great except for one feature. If you like the song and want to download it, I want one button to send you to the proper page. The address is stored in the XML file item as a site address in the field 'link' Examples:

<link>Life Cycles | The Soundsmith</link>
<link>Primary Trigrams of the I Ching | The Soundsmith</link>
<link>After The Fall | The Soundsmith</link>

The command that almost words is this: (I hit Inline Code but nothing happened, sorry)
<li><a id="btn1" class="button3" title="Download This Song" <a href="(jwplayer(radio).getPlaylistItem().link);" target="blank">D/L</a> </li>

HTML:
<!-- The command that almost words is this: -->
<li><a id="btn1" class="button3" title="Download This Song" <a href="(jwplayer(radio).getPlaylistItem().link);" target="blank">D/L</a> </li>

another option that I thought worked  is this:
<li><a id="btn1" class="button3" title="Download This Song" onclick="window.open(deCod(jwplayer(radio).getPlaylistItem().link));">D/L</a></li>
that call is to:
function deCod(linkStr)  {
var str=linkStr;
return str;
}

<!-- I have tried <a href="deCod(jwplayer(radio).getPlaylistItem().link);" target="blank"> with no luck

other commands that DO work include
<li><a id="btn4" class="button3" title="Play/Pause" onclick="jwplayer(radio).play('false');">Pause</a></li>
<li><a id="btn5" class="button3" title="New Song" onclick="jwplayer(radio).playlistNext();">New</a></li>
<li><a id="btn6"  title="Close DashRadio" onclick="window.open('', '_self', '');window.close();"></a></li>  -->
This has two problems - it has worked a couple times when first reloaded and it DOES open the correct page. But then reverts to the error Can't find https://www.davidkempton.com/(jwplayer(radio).getPlaylistItem().link (radio).getPlaylistItem().link)
or sometimes Can;t Find ! TheSoundsmith. That's the MAIN problem The call to getPlaylistItem().link should return the web address as an http:// to open, and does not.
the other issue is that i would like the call to open in the parent window instead of a new tab/window.. I tried variations of target="parent" but got a blank result instead of the error page. BTW I have tried versions of onclick() as well, at least the Anchor opes a window.
I have run the XML files past the validator as well.

Help please. I only do this about every five years and forget EVERYTHING in between... Thanks for what you can offer.
 
Solution
Thanks for your help. I'm not going to worry about the parent problem, This solution does what I need, and I have actual music to make. If someone wants to download a track, they can deal with a second window. Let's consider this closed, and thanks again.
Yeah, makes sense. Making music is more important than changing websites. Please make sure to close the case by marking one of the comments (even if it's your own) as the solution.

New Threads

Buy us a coffee!

Back
Top Bottom