Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3663998
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:35:40+00:00 2026-05-19T01:35:40+00:00

The Javascript below has a default image, but I would like display text only

  • 0

The Javascript below has a default image, but I would like display text “only text url” for this link instead of this button at this link http://developer.mixi.co.jp/wp-content/uploads/2010/09/bt_check_1.gif that this script defaults to. Is this possible?

<div>
<a href="http://mixi.jp/share.pl" class="mixi-check-button" data-key="some-data-key" data-url="http://someurl.com">only text url </a>
<script type="text/javascript" src="http://static.mixi.jp/js/share.js"></script>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:35:40+00:00Added an answer on May 19, 2026 at 1:35 am

    Assuming this is legal (it may not be legal to embed this script in your site if you make modifications to it), we can decompress the script using an online JavaScript beautifier. The result is this:

    http://www.jsfiddle.net/T4Rrh/

    The bit we’re interested in is the last for loop there, where each button is processed. We can safely remove a most of the image generation and protocol sniffing (an unnecessary practice, by the way) to reduce the weight of the code:

    var type = (button["button"] || "button-1.png").split("-");
    var prefix = ("https:" == document.location.protocol) ? "https://mixi.jp/" : "http://static.mixi.jp/";
    if (!type || type.length < 2) type = ["button", "1.png"];
    if (type[1].indexOf(".") == -1) type[1] += ".png";
    var src = (type[0] == "button") ? [prefix, "img/basic/mixicheck_entry/bt_check_", type[1]] : (type[0] == "icon") ? [prefix, "img/basic/mixicheck_entry/icon_mixi_", type[1]] : [prefix, "img/basic/mixicheck_entry/bt_check_1.png"];
    src = src.join("");
    

    and

    var img = document.createElement("img");
    img.setAttribute("src", src);
    img.style.border = "0";
    var element = button.element;
    for (var j = element.childNodes.length - 1; j >= 0; j--) {
        element.removeChild(element.childNodes[j]);
    }
    element.appendChild(img);
    

    should be both removed. You can then minify and save the code, then serve it yourself in your page. Here’s what the cleaned up code looks like: http://www.jsfiddle.net/XrYLX/


    Second Method:

    Using CSS, we first remove the part of the JavaScript which removes all child nodes of the button element, so the text inside the button is not removed:

    for (var j = element.childNodes.length - 1; j >= 0; j--) {
        element.removeChild(element.childNodes[j]);
    }
    

    We then apply some CSS to hide the image:

    .mixi-check-button img {
        display: none;
    }
    

    See: http://www.jsfiddle.net/T4Rrh/1/.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that has a file input control: <input type=file onclick=this.blur() name=descFile
I've been using FB Connect for some time now. The code below has worked
Hi the below Javascript is called when I submit a form. It first splits
Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing
I am using .NET, XSLT to achieve below functionality, however there is some challenges
Note: I've found the causant of my problem. See below for more info. I'll
I have this code, I added JS Script file to my Master page. <script
Short version: What's the best way to stay on the same page to run
The Setup I have designed a very easy to use MVC wizard. The cherry

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.