ajax update using jQuery to external file


I have this within a file called 'product-scores.php' but I want to update the innerHTML of another file (on the same server) like so:

...$('admin_includes/ajax.htm#get_percent_conds_actives').text(data.active_ids+' ').show(1);

View the other code too. Can I do this? How do I check that this ajax.htm file was updated. I'm familiar with firebug but I don't know how to check another external file if it's possible for the ajax update. As well, I don't think that code seems to work but I can't check if the code is updated or not.

            type : 'POST',
            url : 'get_selected_product_info.php',
            dataType : 'json',
            data: {
                product_id : prod_id,
                product_type_id : product_type_id
            success : function(data){
                var cntActiveIds = data.active_ids.length;
                $('admin_includes/ajax.htm#get_percent_conds_actives').text(data.active_ids+' ').show(1);
            error : function(XMLHttpRequest, textStatus, errorThrown) {

Open in new window

Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You can not use JavaScript/jquery to update files, you'll have to add another php file to update the actual text in another file. JavaScript is client side only and can not interact with files on the server other than AJAX requests, which only fetch data.

If you are trying to update another window in the browser, you can do this by changing the context of the jQuery selector to that of the other window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Victor KimuraSEO, Web DeveloperAuthor Commented:

Thanks for that info. I'm wondering if you know of an example of how I can update the context of another window using the jQuery selector. I browsed the site but didn't see an actual example to select another window. Just curious for future use.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.