Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1008199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:44:08+00:00 2026-05-16T08:44:08+00:00

This seems to be a common problem among coders from different languages. I’m using

  • 0

This seems to be a common problem among coders from different languages.

I’m using jQuery to pull AJAX text into a screen, but firebug reports an

unterminated string literal with a worthless example :

$("#content").html("<div class=\'grid_...g\'><\/div>\n<p>Cold Seafood Platters\n

I double checked in my AJAX example text if there were any '‘s, that would have somehow bombed it but i deleted them all, and it still would not parse.

Anyone come across this error before and figure out how to handle it?

UPDATE:

The helper that calls this:

def hq_nav_select(name, url)
  if current_page? url
    content_tag(:li, "<br /> #{link_to(sanitize(name, :tags => 'img'), url, :class => 'hq_nav_link')}", :class => 'selected')
  else
    content_tag(:li, "<br /> #{link_to(sanitize(name, :tags => 'img'), url, :class => 'hq_nav_link')}")
  end
end

The JS:

$(".hq_nav_link").live("click", function(){
    $.ajax({type: "GET", url: $(this).attr("href"), dataType: "script"});
    return false;
});

That triggers the show.js.haml

== $("#content").html("#{ escape_javascript(render :partial => 'tab') }");

And then that loads the partial which is the final text

Example bombing text :

Cold Seafood Platters

<br />\r\nClassic Shrimp Cocktail 
<br />\r\nThe shrimp that we are known for: large or jumbo, tender and tasty shrimp, steamed to order, beautifully arranged and garnished with our homemade cocktail sauce and lemon wedges. 
Medium: Serves 8 &ndash; 6
<br />\r\nLarge: Serves 16 &ndash; 20

<br />\r\n<br />\r\nStone Crab Claws (Seasonal) 
<br />\r\nDirect from Key West, Florida! Get them while you can! Garnished to impress and served with our homemade honey mustard sauce. 
<br />\r\nLarge: Serves 8 - 10

<br />\r\n<br />\r\nMixed Seafood Royale
<br />\r\nThe platter to end all party platters! A generous offering of Lobster Meat, Jumbo Shrimp, and Cocktail Crab Claws, served with a trio of homemade dipping sauces. 
<br />\r\nMedium: Serves 6 - 8
<br />\r\nLarge: Serves 12 - 15

<br />\r\n<br />\r\nPoached Salmon
<br />\r\nBeautiful and healthy as can be! Norwegian Salmon served with a homemade dill sauce. 
<br />\r\nSide of Salmon $15.99/lb ( 3-4 lb.) 

<br />\r\n<br />\r\nCedar Grilled Wild Salmon
<br />\r\nMakes a spectacular presentation! Wild West Coast Salmon glazed and grilled to perfection using a cedar grilling method. 
<br />\r\nSide of Salmon: (4-5 lb) 

<br />\r\n<br />\r\nSmoked Fish Platters

<br />\r\nSmoked Salmon
<br />\r\nThis platter comes garnished with sweet onion &amp; tomato slices, capers and lemon wedges. 
<br />\r\nSmall: Serves 6 &ndash; 8
<br />\r\nLarge: Serves 12 - 15

<br />\r\n<br />\r\nSmoked Fish Combo
<br />\r\nA gourmet feast of specialties! Our own Smoked Salmon, plus Sturgeon, Whitefish and Trout, lusciously arranged and complemented by sweet onion &amp; tomato slices, capers and lemon wedges. 

<br />\r\n<br />\r\nHerring in Wine &amp; Herring in Cream

<br />\r\n<br />\r\nIced Seafood Platters

<br />\r\nImagine the freshest Oysters, Clams, Lobsters, Crab Claws... everything in a shell presented exquisitely on a platter at your next holiday gathering, office party or home event. 

<br />\r\n<br />\r\nChoosing from: King Crab Legs, Jumbo Shrimp, Crab Claws, Scallops, Littleneck Clams, Caviar, New Zealand Mussels, Maine Lobster, and Stone Crab Claws (in season). Speak to one of our Freemans team members to determine the appropriate quantity and variety of shellfish for your celebration. 

<br />\r\n<br />\r\nWe have catering partners who will cater your party with Freemans fresh seafood! 

<br />\r\n<br />\r\nIndoor Clambakes

<br />\r\nExperience a taste of summer during the chill of winter. We supply a complete clambake in our convenient cooking tin, ready for your grill or stovetop. A Freemans specialty, it includes: 
<br />\r\n
<br />\r\nTwo 1/4lb. lobsters, two ears of corn, red potatoes, steamers, two containers of New England or Manhattan chowder and our homemade garlic bread. 
<br />\r\n<br />\r\nFish<br />\r\n&bull; Alaskan White Salmon<br />\r\n&bull; Arctic Char<br />\r\n&bull; Baccala<br />\r\n&bull; Black Bass<br />\r\n&bull; Blowfish Tails<br />\r\n&bull; Boned Shad/Shad Roe<br />\r\n&bull; Carp<br />\r\n&bull; Catfish<br />\r\n&bull; Cod<br />\r\n&bull; Farm Raised Salmon<br />\r\n&bull; Flounder<br />\r\n&bull; Grey Sole<br />\r\n&bull; Lemon Sole<br />\r\n&bull; Haddock<br />\r\n&bull; Halibut<br />\r\n&bull; Mahi Mahi<br />\r\n&bull; Marlin<br />\r\n&bull; Monkfish<br />\r\n&bull; Rainbow Trout<br />\r\n&bull; Red Snapper<br />\r\n&bull; Salmon &ndash; Farmed &amp; Wild<br />\r\n&bull; Salmon Trout<br />\r\n&bull; Spanish Mackerel<br />\r\n&bull; Smelts<br />\r\n&bull; Striped Bass<br />\r\n&bull; Squid<br />\r\n&bull; Swordfish<br />\r\n&bull; Tilapia<br />\r\n&bull; Tuna<br />\r\n&bull; Whitefish<br />\r\n&bull; Whiting<br />\r\n&bull; Yellow Pike<br />\r\n<br />\r\nShellfish<br />\r\n&bull; Backfin &amp; Jumbo Lump Crab<br />\r\n&bull; Crabmeat<br />\r\n&bull; East Coast Oysters<br />\r\n&bull; Littlenecks, Cherrystones &amp; Minced Clams<br />\r\n&bull; Live Blue Claws (seasonal)<br />\r\n&bull; Live Dungeness Crabs<br />\r\n&bull; Live Maine Lobsters<br />\r\n&bull; Medium, Large &amp; Jumbo Shrimp<br />\r\n&bull; New Zealand Mussels<br />\r\n&bull; Prince Edward Island Mussels<br />\r\n&bull; Scallops (Sea, Bay, Diver &amp; Nantucket)<br />\r\n&bull; Soft Shell Crabs (seasonal)<br />\r\n&bull; Steamers &bull; Wellfleet Oysters<br />\r\n<br />\r\nFrozen<br />\r\n&bull; Alaskan King Crab Legs<br />\r\n&bull; Alligator Meat<br />\r\n&bull; Brazilian Lobster Tails<br />\r\n&bull; Cleaned Squid<br />\r\n&bull; Crawfish Meat<br />\r\n&bull; Lobster Meat<br />\r\n&bull; Louisiana Crawfish Tails<br />\r\n&bull; Orange Roughy<br />\r\n&bull; Pulpo<br />\r\n&bull; Snow Crab Claws<br />\r\n<br />\r\n<br />\r\nSeafood Salads and Buffet Platters

<br />\r\nSeafood Salads
<br />\r\nA fine selection of homemade specialty salads. Available a la carte or by the pound. Tastefully presented on catering trays at your request.<br />\r\n<br />\r\n&bull; Baccala Salad<br />\r\n&bull; Calamari Salad<br />\r\n&bull; Frutta Di Mare<br />\r\n&bull; Lobster Salad<br />\r\n&bull; Shrimp Salad<br />\r\n&bull; Mixed Seafood Salad<br />\r\n&bull; Fresh Salmon Salad<br />\r\n&bull; Fresh Tuna Salad<br />\r\n&bull; Smoked Salmon Salad<br />\r\n&bull; Smoked Whitefish Salad<br />\r\n<br />\r\nLuncheon &ndash; Dinner
<br />\r\nOur most popular lunch and dinner entr&eacute;es. Available a la carte, individually or by the pound. Tastefully presented on platters at your request.<br />\r\n<br />\r\n&bull; Cedar Grilled Salmon<br />\r\n&bull; Codfish Cakes<br />\r\n&bull; Crawfish Cakes<br />\r\n&bull; Fried Tilapia<br />\r\n&bull; Flounder Fran&ccedil;ais<br />\r\n&bull; Jumbo Lump Crabcakes<br />\r\n&bull; Lobster Rolls<br />\r\n&bull; Poached Salmon<br />\r\n&bull; Tuna Sandwich<br />\r\n&bull; Fresh Steamed Shrimp<br />"

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:44:09+00:00Added an answer on May 16, 2026 at 8:44 am

    If you just need text or HTML, change the dataType:

    $.ajax({type: "GET", url: $(this).attr("href"), dataType: "html"}); // for HTML
    $.ajax({type: "GET", url: $(this).attr("href"), dataType: "text"}); // for raw text
    

    Otherwise jQuery will evaluate the response as JavaScript (from http://api.jquery.com/jQuery.ajax/). In this case, you probably want dataType: “html” when coming from a Rails content_tag.

    UPDATED: Try the shortcut version, this also writes to the #content element:

    $.get($(this).attr('href'), function(response) { $('#content').html(response); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 493k
  • Answers 493k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You're interating over the divs containing the checkboxes, so you… May 16, 2026 at 10:41 am
  • Editorial Team
    Editorial Team added an answer CommandManager.RequerySuggested += value means that if the function for CanExecute… May 16, 2026 at 10:40 am
  • Editorial Team
    Editorial Team added an answer I follow a couple of rules to keep my applications… May 16, 2026 at 10:40 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

This seems like a pretty common problem, but I haven't found any sort of
It seems that log4j has some class loading issues (among others) and it seems
I'm using SQLite to maintain a database which contains, among other things, a table
Edit: changing .ready() call per Matt's suggestion. I use jQuery to configure some stuff
I'm using the Google maps API (v2) to display a country overlay over a
I'm using the Spring MVC to build a thin layer on top of a
Plenty of applications seem to do this. For example, go to Apple's mail application
I have started working on what I expect to become, by far, the largest
Over the past few years I've been on projects where we've run into a
I'm learning JUnit. Since my app includes graphical output, I want the ability to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.