Giải pháp là thêm một đoạn script nhỏ khi đưa thư viện Prototype vào Blogger. Thường thì ta đặt đoạn code sau đây vào trước thẻ </head> trong Template.
<script src='http://www.google.com/jsapi'/>
<script>
google.load("prototype", "1.6.1.0");
google.load("scriptaculous", "1.8.3");
</script>
<script>
google.load("prototype", "1.6.1.0");
google.load("scriptaculous", "1.8.3");
</script>
Để khắc phục vấn đề không hiển thị tiện ích Người theo dõi, cần phải sử dụng đoạn code như thế này.
<script src='http://www.google.com/jsapi'/>
<script>
google.load("prototype", "1.6.1.0");
window.JSON = {
parse: function (st) { return st.evalJSON(); },
stringify: function(obj) { return Object.toJSON(obj); }
};
google.load("scriptaculous", "1.8.3");
</script>
<script>
google.load("prototype", "1.6.1.0");
window.JSON = {
parse: function (st) { return st.evalJSON(); },
stringify: function(obj) { return Object.toJSON(obj); }
};
google.load("scriptaculous", "1.8.3");
</script>
Phần được đánh dấu màu đỏ là phần thêm vào để xử lý sự không tương thích giữa Prototype và script trong tiện ích Người theo dõi.
Không có nhận xét nào:
Đăng nhận xét