Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

angularjs - Using Disqus for ajax loaded Modal

I'm having a modal that loads different content (imagine different profiles for products), and I want to add a review section for a product in the modal. I thought about making it by myself, but the HTML markup, PHP backend handling, comment reply, and image upload all that are just very complicated (and time consuming). So I decide to use Disqus. I've used Disqus before. I know it works pretty fine with stand alone pages. What I'm not sure if how it will work with ajax loaded Modal? For example, how does Disqus know the product is different and the comment section should change accordingly?

Since I'm using AngularJS framework, I checked out this nice directive: https://github.com/kirstein/angular-disqus/wiki Well, this still doesn't explain how should I let disqus know the product is different, and it needs to generate a different comment section.

Can I get any help from here?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your problem is you need to set the unique Disqus identifier

More about it here

Example:

The following uses a unique id (maybe your product ID) as an identifier.

var disqus_identifier = '2583573';

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...