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 8000759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:54:04+00:00 2026-06-04T15:54:04+00:00

I hope this is possible. I have a HTML file that loads an js

  • 0

I hope this is possible. I have a HTML file that loads an js file using: <script src="js.js"></script>
In this script there is a var: var score = 0; This var changes when people get points.

Now in this same HTML file I have added the following Dialog script (also see https://developers.facebook.com/docs/reference/dialogs/feed/ for more info):

FB.init({appId: "xxxxxxxxxxxxx", status: true, cookie: true});

function postToFeed() {
    // calling the API ...
var obj = {
        method: 'feed',
    link: 'https://developers.facebook.com/docs/reference/dialogs/',
    picture: '',
    name: 'I just got a new high score of [xx] points!',
    caption: 'Think you can do better?',
    description: 'Join me.'
};

function callback(response) {
    document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}

FB.ui(obj, callback);
}

This script works and the Dialog box appears. Now at the part [xx] points I want to show the points people have earned.

I’ve tried the following:

Pushed the var result to an input field <input type="text" id="score" name="score" value="0" readonly /> using $('#score').val(document.getElementById('sc').innerHTML); in the js.js file, which results that the score shows up in the input field.

And then tried at the [xx] part: ' + document.getElementById('score').innerHTML + ', but this didn’t work. Perhaps this approach is wrong and there is a better way, but how can I show the score in the Dialog?

Kind regards,

Maurice

  • 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-06-04T15:54:06+00:00Added an answer on June 4, 2026 at 3:54 pm

    As far as I can tell from your description score is a global variable. you can do something like:

    var obj = {
        method: 'feed',
        link: 'https://developers.facebook.com/docs/reference/dialogs/',
        picture: '',
        name: 'I just got a new high score of ['+ score +'] points!',
        caption: 'Think you can do better?',
        description: 'Join me.'
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Google Instant style jQuery search script that queries a PHP file
Is it possible to split the contents of file into parts that have specific
I'm wondering if this is possible. I have html like so: <p> <font face=Georgia>
Hope this makes sense... Is there a simple way to return a set of
I hope this is allowed but I have a number of questions regarding Facebook
Is it possible to have to make a html for helper in asp.net mvc
I have got this project that uses excel for some calculation. This excel is
So i have this EasySlider 1.7 and loads of images i want to show
Doubt this is possible as I don't have a 1 page app, but pretty
is it possible to have a visible html element but one which lacks presence

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.