당신은 여기에 쉼표를 후행에 많은 정보를 정기적으로 찾을 : 그것은 "바로"에서 쉼표에 관하여 Are trailing commas in arrays and objects part of the spec?IE7/IE8에서 작업 (자바 스크립트) 쉼표를 후행 받기
.
[
{ title: "..", display: function() { return ".."; } },
{ title: "..", display: function() { return ".."; } },
{ title: "..", display: function() { return ".."; } }, // <--right there
]
내 문제는 타사 도구는 후행 쉼표로이 목록을 생성하고, 나는이 도구의 소스 코드에 액세스 할 수 없습니다 오전, 지금이다. I
<body>
my stuff
<!-- the folloging div with the javascript comes from the 3rd party -->
<div class="item"><script type="text/javascript">
$(document).ready(function() {
$.supersized({
// Functionality
slide_interval : 8000, // Length between transitions
transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
transition_speed : 400, // Speed of transition
fit_always : 0, //Prevents the image from being cropped by locking it at 100% width.
min_width : 600, //min-width of images
random : 0, //random img
vertical_center : 1, //vertical alignment
// Components
slide_links : 'false', // Individual links for each slide (Options: false, 'number', 'name', 'blank')
slides : [ // Slideshow Images
{image : 'image1.jpg', otherstuff: 'blah', moreotherstuff: 'lorem'},
{image : 'image2.jpg', otherstuff: 'blub', moreotherstuff: 'ipsum'},
]
});
});
</script></div>
이제는 IE7/IE8에서 작동하는 방법이 있는지 묻습니다.
(내가 제 3 자 편집 할 수 있으며, 서버에 액세스 할 수있는) 지금 바로 볼 수있는 유일한 방법은 다음과 같습니다 - 그 DIV 없이 특별한 출력을 제공 - 아약스를 통해 정상 측 요청 - 모든 구문을 분석하고이 div를 가져 와서 마지막 쉼표를 삭제하고 자바 스크립트를 실행하십시오.
사실 내가 원하는 방식이 아닙니다. 이 문제를 해결할 수있는 또 다른 방법이 있습니까?
나는 그것을 당신의 방식대로했습니다. 고마워요. – nbar