0
在自定義wordpress頁面上,我點擊我的鏈接,出現此錯誤 此外鏈接無法打開。點擊不會執行任何操作。沒有'Access-Control-Allow-Origin'標題出現在請求的資源上
XMLHttpRequest無法加載mysite /。請求的資源上沒有「Access-Control-Allow-Origin」標題。因此不允許Origin'mysite'訪問。
其中mysite是我的網站的網址。
有人熟悉這個問題嗎?
發生錯誤的頁面是:http://wouterleduc.com/publications/
而且我用我的頁面模板的代碼: `
<?php if (have_posts()) : the_post(); ?>
<h3 class="h3_serie_overzicht"><?php the_title(); ?><span id="<?php the_title();?>"> </span><a href"#" class="serie_overzicht_info" id="<?php the_title(); ?>">Show text</a></h3>
<div class="serie_overzicht_info_pane"><?php echo the_content(); ?></div>
<div id="serie-overzicht-thumbs">
<?php $attachments = new Attachments('attachments'); ?>
<?php if($attachments->exist()) : ?>
<div class="serie_overzicht_row">
<?php while($attachments->get()) : ?>
<div class="serie_foto">
<a target="_blank" href="<?php echo $attachments->field('link'); ?>" title="<?php echo $attachments->field('title'); ?>"><img src="<?php echo $attachments->src('medium'); ?>"" title="<?php echo $attachments->field('title'); ?>" alt="<?php echo $attachments->field('title'); ?>" /><br /><span><?php echo $attachments->field('title'); ?></span></a>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>
`
我用的附件喬納森克里斯托弗pluging來顯示圖像。我在我的主題中使用fancybox,但它應該隻影響與rel標籤的鏈接。
嘿Snow6boy,謝謝你的回答。我已經添加了你在我的index.php中建議的php代碼,這是爲wordpress組裝所有需要的代碼的文件,但這仍然會觸發相同的錯誤。 我很困惑的是,我不想在這裏做一些難題。只需輸出一個錨標籤。純html。 因此,我認爲問題是用腳本或其他東西,但我卡在什麼是造成它 – ragoutje 2014-10-02 17:33:27