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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:18:00+00:00 2026-05-28T13:18:00+00:00

I have the following script: <script> (function(d, s, id, p) { var js, ins

  • 0

I have the following script:

<script>
    (function(d, s, id, p) {
var js, ins = d.getElementsByTagName(s)[0];
    js = d.createElement(s); 
    js.src = "http://www.site.com/feeds/run.php?id="+id+"&p="+p;
    ins.parentNode.insertBefore(js, ins);
data();
}(document, 'script', 131, 'large'));
</script>

The run.php actually returns a javascript which is running fine and executing a few functions, but the function I call in the above script (data();) will not execute. The data function reads:

function data(){
    var u;
    alert("I am an alert box");
    u = document.URL;
    document.body.innerHTML += '<form id="dynForm" target="transFrame" action="http://www.site.com/data.php" method="post"><input type="hidden" name="u" value="'+u+'"></form>';
    document.getElementById("dynForm").submit();
}

If anyone has information that may help me run this function it would be much appreciated.

— Chris Shouts —
I have checked all the functions and they are fine. If I embed the script like:

<script type="text/javascript" src="http://www.site.com/feeds/run.php"></script>

But I can’t use this line because I intend for people to add this to their websites and don’t want them to remove these lines to stop certain operations. But when I do use this method I have to choose between running the other other functions in the file or this one.

  • 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-28T13:18:01+00:00Added an answer on May 28, 2026 at 1:18 pm

    After inserting the script containing the data function, you don’t wait for the script to finish loading, so the data function isn’t available yet.

    Try this:

    (function(d, s, id, p) {
    var js, ins = d.getElementsByTagName(s)[0];
        js = d.createElement(s); 
        js.src = "http://www.site.com/feeds/run.php?id="+id+"&p="+p;
        ins.parentNode.insertBefore(js, ins);
        var timer = setInterval(tryData, 100);
        function tryData()
        {
            if(window.data)
            {
                clearInterval(timer);
                data();
            }
        }
    }(document, 'script', 131, 'large'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following: $(document).ready(function() { var myIframe = document.getElementById('myIframe'); var element = myIframe.contentDocument.createElement('script');
Hi I have the following script in my form function pdf() { var frm
I have the following script: Timer=0; function countdown(auctionid){ var auctions; var divs; Timer=Timer+1; if((Timer%10==0)||(Timer==1)){
I have put together the following mootools script window.addEvent('domready', function() { var shouts =
I have the following HTML / JS: <html> <body> <script> function foo(){ var html
I have the following dummy test script: function test() { var x = 0.1
I have the following script: function add_fields(link, association, content) { var new_id = new
I have the following script: <script language=javascript> function process(v){ var value = parseInt(document.getElementById('v').value); value+=v;
I have the following script: $(#border-radius).click(function(){ var value = $(#border-radius).attr(value); $(div.editable).click(function () { mySQLinsert(value,
I have following script: $('.news ul li').hide(); $('.news ul li:first-child').show(); function Roller() { var

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.