JavaScript lets dedecms farewell to handwriting tag_javascript tips

Source: Internet
Author: User
Tags urlencode

1. Open \dede\templets\album_add.htm file, in the top head of the JS script area to add JS method.

function Setag () {
 var tagg=window.showmodaldialog ("tags_main.php", "tag", "dialogwidth=800px;dialogheight= 600px "); 
  if (typeof (Tagg)!= ' undefined ') Document.form1.tags.value=tagg; 
      }


2. In the tag label input TD, add

<input type= "button" onclick= "Setag ()" value= "select" style= "Width:70px;cursor:pointer;"/>
a button.

3. Transformation of \dede\templets\tags_main.php documents. Add the following JS code to the top head in the JS script area.

Select the keyword
var tag= "";
function Selecttag (str)
{
tag=tag+ "," +STR;
if (tag.substr (0,1) = = ', ') tag=tag.substr (1);
 $ ("#selecttag"). val (tag);

function Selecttagok ()
{
window.returnvalue= $ ("#selecttag"). Val (); 
Window.close (); 
}

4. Add the following HTML in any position in the body, PS: where you want to show.

<div style= "padding-left:20px;border:1px" > Selected tag: <input type= ' text ' id= ' selecttag ' name= ' "Selecttag ' Type= '/><input "button" onclick= "Selecttagok ()" value= "OK choice"/> </div>

5. Find the tags in the tag list

<a href= ". /tags.php?/<?php Echo UrlEncode ($fields [' tag ']);? >/"target= _blank" >{dede:field.tag/}</a>

Modify it to:

<a href= ". /tags.php?/<?php Echo UrlEncode ($fields [' tag ']);? >/"target= 
_blank" >{dede:field.tag/}</a> <a href= "#" onclick= "Selecttag (' {dede:field.tag/} ')" >[select]</a>

Use Help:

Modify the page to refer to the Add page for JS code Add.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.