English 中文(简体)
j using using 和e8 采用id select select 似乎不可行(使用1.5.1)
原标题:jQuery and ie8 using id selector does not appear to be working (using 1.5.1)

I m 创建传证员,使XML的档案充满证言。 每一证言均被指定为“级”,以便各页能够具体说明使用哪类证言(例如,“公司”或“刚果人”,并且有相关的参考资料。)

The problem is that in IE8 (even with the compatibility meta included) the html within the specific ID s is not changed. I switched to classes to ensure that Chrome worked (Firefox always works.) Below is an example using classes:

 $("span.quote").html("&quot;" + $(this).find("quote").text() + "&quot;<br />");
//print each testimonial name, title, and org if exists

  $("span.attrib").html("- " + $(this).find("name").text() + "");
  $("span.attrib").append(", " + $(this).find("title").text() + "");
  $("span.attrib").append(", " + $(this).find("organization").text() + "<br />");

These work in Firefox and Chrome. The code below using the ID selector works only in Firefox, but is my preferred method.

 $("#quote").html("&quot;" + $(this).find("quote").text() + "&quot;<br />");
//print each testimonial name, title, and org if exists

  $("#attrib").html("- " + $(this).find("name").text() + "");
  $("#attrib").append(", " + $(this).find("title").text() + "");
  $("#attrib").append(", " + $(this).find("organization").text() + "<br />");

我的“超声望”:

<span id="quote">
"This is the default quote."
</span>
<span id="attrib">
- Default name, default title, default organization
</span>

该法典中有哪些不正确之处是,IE8获得的报价正确无误? 当我从选任人转向警告时(为了保证平整的休息工作),所有东西都会被罚款。

欢迎任何意见。 这里的损失。 回到“网络”或“闪电”项目,让它坐了几个小时。

抢劫

添加更多的法典实例:

证人证词的内容

var filter_value = new String();

$(document).ready(readfilterXML("golf"));

function readfilterXML(passed_value)
{
    filter_value = passed_value;
  $.ajax({
    type: "GET",
    url: "testimonials.xml",
    dataType: "xml",
    success: parseXml
  });
}

function parseXml(xml)
{
    var holdclass = filter_value;
    // need to seek class within id "quote" like "#quote.class" to find out what it is
  //find every testimonial and load the array
  $(xml).find("testimonial").each(function()
  {
    var tempclass = $(this).attr("class");
//  $("#error").html(tempclass);
    if (tempclass == holdclass)  {
  $("span#quote").html("&quot;" + $(this).find("quote").text() + "&quot;<br />");
//print each testimonial name, title, and org if exists
  $("span#attrib").html("- " + $(this).find("name").text() + "");
  $("span#attrib").append(", " + $(this).find("title").text() + "");
  $("span#attrib").append(", " + $(this).find("organization").text() + "<br />");
}
});
}
问题回答

Do you have more than one <span> with the same id? These id s seem pretty generic if you are going to have multiple quotes in your html.

如果你有多种相同的id,每名浏览器将以不同的方式打断。

P.S. 更多的法典将是有益的。





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签