通过使用addthis在aspx页面社交共享中不共享图像,标题,描述数据,因此我添加了meta标签

问题描述

我使用addthis插件在Facebook,Twitter,linkedin,Whatsaap中不共享数据的地方,所以我添加了元标记,其中元标记共享与静态内容一起工作,但是aspx页面具有动态发布的API数据。

我需要动态元标记,其中来自api的数据附加在元标记中。

在Facebook调试器中进行调试时,它没有显示动态数据。

这些是元标记

 <Meta name="twitter:title" content="Impact Of Labor Reforms On Ease Of Doing Business">
 <Meta name="twitter:description" content="Already lots have been discussed about the migrant laborer’s and their difficulties,so delving deep into the solutions which the central government has come out with through the amendments in the labor laws as committed at the beginning of 2020.">
    <Meta name="twitter:image" content="https://advantagehrm.com/Uploads/UploadImage/Img2b251f472-7a88-4110-8acd-4677aa461696.jpg" />   
    <Meta name="twitter:image:src" content="https://advantagehrm.com/Uploads/UploadImage/Img2b251f472-7a88-4110-8acd-4677aa461696.jpg">
    <Meta property="og:image:type" content="image/png">  
    <Meta property="og:title" content="Impact Of Labor Reforms On Ease Of Doing Business">   
    <Meta property="og:url" content="https://advantagehrm.com/PostMaster/DetailNews.aspx?id=69">
    <Meta property="og:image" content="https://advantagehrm.com/Uploads/UploadImage/Img2b251f472-7a88-4110-8acd-4677aa461696.jpg" />
    <Meta property="og:image:secure_url" content="https://advantagehrm.com/Uploads/UploadImage/Img2b251f472-7a88-4110-8acd-4677aa461696.jpg" />
    <Meta property="og:description" content="Already lots have been discussed about the migrant laborer’s and their difficulties,so delving deep into the solutions which the central government has come out with through the amendments in the labor laws as committed at the beginning of 2020.">
    <Meta property="fb:app_id" content="899581643899672"> 

这是将数据附加到元标记中的代码

 $(document).prop('title',getData[j].PostTitle);            
                             $('#divMeta').attr('data-title',getData[j].PostTitle);                                        
                            $('#divMeta').attr('data-description',getData[j].Description.substring(1,20));
                            $('#divMeta').attr('data-media','https://advantagehrm.com' + getData[j].PostImg.replace("~",""));
                           
                           
                           $("Meta[property='og\\:title']").attr('content',getData[j].PostTitle);   
                           $("Meta[name='twitter\\:title']").attr('content',getData[j].PostTitle);
                           
                           
                           $("Meta[name='twitter\\:image\\:src']").attr('content',""));
                           $("Meta[name='twitter\\:image']").attr('content',""));
                           $("Meta[property='og\\:image\\:secure_url']").attr('content',""));

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...